<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>jakobloekkemadsen.com</title>
	
	<link>http://www.jakobloekkemadsen.com</link>
	<description>Usability through code.</description>
	<lastBuildDate>Mon, 17 Sep 2012 14:49:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Jakobloekkemadsen" /><feedburner:info uri="jakobloekkemadsen" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>TDCSS.js</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/nuqh--5e6EQ/</link>
		<comments>http://www.jakobloekkemadsen.com/2012/09/tdcss-js/#comments</comments>
		<pubDate>Mon, 17 Sep 2012 14:49:25 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Ikke kategoriseret]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=339</guid>
		<description><![CDATA[<h3>Test driven CSS development</h3>
<p>I&#8217;m a huge fan of <a href="http://en.wikipedia.org/wiki/Test-driven_development" title="tdd on wikipedia">test-driven development</a>!<br />
Almost every day, I make use of unit tests when writing Javascript. TDD helps me focus my development on singular tasks, and it enables me to easily verify that all my stuff works after refactorings or other kinds of changes.</p>
<p>One day I thought: &#8220;Why don&#8217;t we have this for CSS?&#8221;.</p>
<p>CSS &#8211; especially for large projects with many developers &#8211; is a major pain!<br />
There are no clear-cut rules for modularity, the inheritance mechanisms are obscure, and the runtime environments (the browsers) are still no way near consistent in their interpretations of style rules.</p>
<p>It occurred to me that TDD methodology would be a great way to tackle these problems.</p>
<h3>Enter <a href="https://github.com/jakobloekke/tdcss.js" title="tdcss.js">tdcss.js</a></h3>
<p>What I wanted was a way to specify UI elements in an isolated context &#8211; similar to the &#8220;units&#8221; in unit testing, so I could apply my styling and continuously verify that already styled elements still looked like expected. This would also force a modularity focus onto my CSS which is highly desirable when working on big projects.</p>
<p>I won&#8217;t go into details about the implementation in this post.<br />
Here&#8217;s a screenshot of the tdcss test-suite together with the HTML code that generates it.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&#60;!-- # Box styles --&#62;
&#160;
&#60;!-- : Basic box --&#62;
&#60;div class=&#34;box&#34;&#62;
    &#60;p&#62;This is a basic box.&#60;/p&#62;
&#60;/div&#62;
&#160;
&#60;!-- : Notice box --&#62;
&#60;div class=&#34;box-notice&#34;&#62;
    &#60;p&#62;This is a notice box.&#60;/p&#62;
&#60;/div&#62;
&#160;
&#60;!-- : Warning box --&#62;
&#60;div class=&#34;box-warning&#34;&#62;
    &#60;p&#62;This is a warning box.&#60;/p&#62;
&#60;/div&#62;
&#160;
&#60;!-- : Alert box --&#62;
&#60;div class=&#34;box-alert&#34;&#62;
    &#60;p&#62;This is an alert box.&#60;/p&#62;
&#60;/div&#62;
&#160;
&#160;
&#160;
&#60;!-- # Typography --&#62;
&#160;
&#60;!-- : H1 --&#62;
&#60;h1&#62;This is an H1 header.&#60;/h1&#62;
&#60;!-- : H2 --&#62;
&#60;h2&#62;This is an H2 header&#60;/h2&#62;
&#60;!-- : H3 --&#62;
&#60;h3&#62;This is an H3 header&#60;/h3&#62;
&#160;
&#160;
&#160;
&#60;!-- # Custom height --&#62;
&#160;
&#60;!-- : Some element that needs a lot of space; 700px --&#62;
&#60;h3&#62;This is a test.&#60;/h3&#62;</pre></div></div>

<p><img src="https://github.com/jakobloekke/tdcss.js/raw/master/demo/preview.png" alt="Demo screenshot" /></p>
<p>Go to <a href="https://github.com/jakobloekke/tdcss.js" title="tdcss.js">https://github.com/jakobloekke/tdcss.js</a> for instructions on how to use it &#8211; and to download it, of course. <img src='http://www.jakobloekkemadsen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></description>
			<content:encoded><![CDATA[<h3>Test driven CSS development</h3>
<p>I&#8217;m a huge fan of <a href="http://en.wikipedia.org/wiki/Test-driven_development" title="tdd on wikipedia">test-driven development</a>!<br />
Almost every day, I make use of unit tests when writing Javascript. TDD helps me focus my development on singular tasks, and it enables me to easily verify that all my stuff works after refactorings or other kinds of changes.</p>
<p>One day I thought: &#8220;Why don&#8217;t we have this for CSS?&#8221;.</p>
<p>CSS &#8211; especially for large projects with many developers &#8211; is a major pain!<br />
There are no clear-cut rules for modularity, the inheritance mechanisms are obscure, and the runtime environments (the browsers) are still no way near consistent in their interpretations of style rules.</p>
<p>It occurred to me that TDD methodology would be a great way to tackle these problems.</p>
<h3>Enter <a href="https://github.com/jakobloekke/tdcss.js" title="tdcss.js">tdcss.js</a></h3>
<p>What I wanted was a way to specify UI elements in an isolated context &#8211; similar to the &#8220;units&#8221; in unit testing, so I could apply my styling and continuously verify that already styled elements still looked like expected. This would also force a modularity focus onto my CSS which is highly desirable when working on big projects.</p>
<p>I won&#8217;t go into details about the implementation in this post.<br />
Here&#8217;s a screenshot of the tdcss test-suite together with the HTML code that generates it.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!-- # Box styles --&gt;
&nbsp;
&lt;!-- : Basic box --&gt;
&lt;div class=&quot;box&quot;&gt;
    &lt;p&gt;This is a basic box.&lt;/p&gt;
&lt;/div&gt;
&nbsp;
&lt;!-- : Notice box --&gt;
&lt;div class=&quot;box-notice&quot;&gt;
    &lt;p&gt;This is a notice box.&lt;/p&gt;
&lt;/div&gt;
&nbsp;
&lt;!-- : Warning box --&gt;
&lt;div class=&quot;box-warning&quot;&gt;
    &lt;p&gt;This is a warning box.&lt;/p&gt;
&lt;/div&gt;
&nbsp;
&lt;!-- : Alert box --&gt;
&lt;div class=&quot;box-alert&quot;&gt;
    &lt;p&gt;This is an alert box.&lt;/p&gt;
&lt;/div&gt;
&nbsp;
&nbsp;
&nbsp;
&lt;!-- # Typography --&gt;
&nbsp;
&lt;!-- : H1 --&gt;
&lt;h1&gt;This is an H1 header.&lt;/h1&gt;
&lt;!-- : H2 --&gt;
&lt;h2&gt;This is an H2 header&lt;/h2&gt;
&lt;!-- : H3 --&gt;
&lt;h3&gt;This is an H3 header&lt;/h3&gt;
&nbsp;
&nbsp;
&nbsp;
&lt;!-- # Custom height --&gt;
&nbsp;
&lt;!-- : Some element that needs a lot of space; 700px --&gt;
&lt;h3&gt;This is a test.&lt;/h3&gt;</pre></div></div>

<p><img src="https://github.com/jakobloekke/tdcss.js/raw/master/demo/preview.png" alt="Demo screenshot" /></p>
<p>Go to <a href="https://github.com/jakobloekke/tdcss.js" title="tdcss.js">https://github.com/jakobloekke/tdcss.js</a> for instructions on how to use it &#8211; and to download it, of course. <img src='http://www.jakobloekkemadsen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
 <p><a href="http://www.jakobloekkemadsen.com/?flattrss_redirect&amp;id=339&amp;md5=2c48eea3e1393868b7d8fdee9bf1740c" title="Flattr" target="_blank"><img src="http://www.jakobloekkemadsen.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/nuqh--5e6EQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2012/09/tdcss-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=jakobloekke&amp;popout=1&amp;url=http%3A%2F%2Fwww.jakobloekkemadsen.com%2F2012%2F09%2Ftdcss-js%2F&amp;language=en_GB&amp;category=text&amp;title=TDCSS.js&amp;description=Test+driven+CSS+development+I%26%238217%3Bm+a+huge+fan+of+test-driven+development%21+Almost+every+day%2C+I+make+use+of+unit+tests+when+writing+Javascript.+TDD+helps+me+focus+my+development+on...&amp;tags=blog" type="text/html" />
	<feedburner:origLink>http://www.jakobloekkemadsen.com/2012/09/tdcss-js/</feedburner:origLink></item>
		<item>
		<title>Specs and creativity</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/8dx0ttB7PIg/</link>
		<comments>http://www.jakobloekkemadsen.com/2012/05/specs-and-creativity/#comments</comments>
		<pubDate>Wed, 23 May 2012 19:49:19 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Creativity]]></category>
		<category><![CDATA[Creative process]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=303</guid>
		<description><![CDATA[<p>Today I became aware of the existence of the <a title="The Joel Test" href="http://www.joelonsoftware.com/articles/fog0000000043.html">Joel Test</a> &#8211; a list of questions for assessing the quality of a software development team:</p>
<blockquote>
<ol>
<li>Do you use source control?</li>
<li>Can you make a build in one step?</li>
<li>Do you make daily builds?</li>
<li>Do you have a bug database?</li>
<li>Do you fix bugs before writing new code?</li>
<li>Do you have an up-to-date schedule?</li>
<li>Do you have a spec?</li>
<li>Do programmers have quiet working conditions?</li>
<li>Do you use the best tools money can buy?</li>
<li>Do you have testers?</li>
<li>Do new candidates write code during their interview?</li>
<li>Do you do hallway usability testing?</li>
</ol>
</blockquote>
<p>I was puzzled by number 7: <em>&#8220;Do you have a spec?&#8221;</em>, but soon found out that it just means: <em>Do you write specs before coding?</em><br />
(Fair enough. I thought &#8220;spec&#8221; meant something else in this context.)</p>
<p>Joel explains:</p>
<blockquote><p>&#8220;Writing specs is like flossing: everybody agrees that it&#8217;s a good thing, but nobody does it.<br />
I&#8217;m not sure why this is, but it&#8217;s probably because most programmers hate writing documents. As a result, when teams consisting solely of programmers attack a problem, they prefer to express their solution in code, rather than in documents. They would much rather dive in and write code than produce a spec first.&#8221;</p></blockquote>
<p>I feel that way exactly!<br />
I know specs are an important alignment tool when communicating with team members &#8211; to keep everyone on the same page, so to speak.<br />
But they&#8217;re <em>boring</em> to write, and I often have the feeling that the spec writing process takes away an important creative aspect of programming. They tend to make you avoid the unknown and take the safe road.<br />
We are often told that programming is a creative endeavor and this is very true.</p>
<p>But why is the creative aspect valuable?<br />
One of the things that characterizes other creative fields &#8211; such as art or music &#8211; is that the artist tends to draw inspiration from the interaction with his or her tools. This inspiration is often a key source of innovation. I bet you <a title="Hendrix" href="http://www.youtube.com/watch?v=bS8NcNnwl9U">Jimi Hendrix</a> didn&#8217;t plan on his guitar sounding like <em>that</em> the first time he accidentally cranked up the gain too much and made it feed!<br />
But he saw the potential and made rock history with that sound.</p>
<p>I&#8217;m certainly no Jimi Hendrix, but I do know this kind of creative process first hand:<br />
<a title="My music" href="http://soundcloud.com/jack-rock/">When I&#8217;m working on music</a>, I would, for instance, never dream of having a spec!<br />
Instead, what I do is keep my ideas microscopic, then try them out and get something more or less unexpected in return from my machines. Typically, hearing this will spark a new idea in my head, and so in a prolonged, iterative process, I&#8217;ll produce a piece of music in close collaboration with my collection of electronic equipment. The result is completely unknown, until it&#8217;s suddenly deemed finished.</p>
<p>Of course, that kind of uncompromised creative flow is not viable in a business context &#8211; and I&#8217;m sure more commercially successful musical artists than me have some way of sneaking a &#8220;spec&#8221; or a plan into the process in order to keep their productivity high. Inspiration is quite unreliable at times. Any artist will tell you that!</p>
<p>But when it comes to programming, where do we draw the line?<br />
How do we keep control of our productivity, while still keeping our process open to the kind of sudden inspirational insights that fuel innovation?</p>
]]></description>
			<content:encoded><![CDATA[<p>Today I became aware of the existence of the <a title="The Joel Test" href="http://www.joelonsoftware.com/articles/fog0000000043.html">Joel Test</a> &#8211; a list of questions for assessing the quality of a software development team:</p>
<blockquote>
<ol>
<li>Do you use source control?</li>
<li>Can you make a build in one step?</li>
<li>Do you make daily builds?</li>
<li>Do you have a bug database?</li>
<li>Do you fix bugs before writing new code?</li>
<li>Do you have an up-to-date schedule?</li>
<li>Do you have a spec?</li>
<li>Do programmers have quiet working conditions?</li>
<li>Do you use the best tools money can buy?</li>
<li>Do you have testers?</li>
<li>Do new candidates write code during their interview?</li>
<li>Do you do hallway usability testing?</li>
</ol>
</blockquote>
<p>I was puzzled by number 7: <em>&#8220;Do you have a spec?&#8221;</em>, but soon found out that it just means: <em>Do you write specs before coding?</em><br />
(Fair enough. I thought &#8220;spec&#8221; meant something else in this context.)</p>
<p>Joel explains:</p>
<blockquote><p>&#8220;Writing specs is like flossing: everybody agrees that it&#8217;s a good thing, but nobody does it.<br />
I&#8217;m not sure why this is, but it&#8217;s probably because most programmers hate writing documents. As a result, when teams consisting solely of programmers attack a problem, they prefer to express their solution in code, rather than in documents. They would much rather dive in and write code than produce a spec first.&#8221;</p></blockquote>
<p>I feel that way exactly!<br />
I know specs are an important alignment tool when communicating with team members &#8211; to keep everyone on the same page, so to speak.<br />
But they&#8217;re <em>boring</em> to write, and I often have the feeling that the spec writing process takes away an important creative aspect of programming. They tend to make you avoid the unknown and take the safe road.<br />
We are often told that programming is a creative endeavor and this is very true.</p>
<p>But why is the creative aspect valuable?<br />
One of the things that characterizes other creative fields &#8211; such as art or music &#8211; is that the artist tends to draw inspiration from the interaction with his or her tools. This inspiration is often a key source of innovation. I bet you <a title="Hendrix" href="http://www.youtube.com/watch?v=bS8NcNnwl9U">Jimi Hendrix</a> didn&#8217;t plan on his guitar sounding like <em>that</em> the first time he accidentally cranked up the gain too much and made it feed!<br />
But he saw the potential and made rock history with that sound.</p>
<p>I&#8217;m certainly no Jimi Hendrix, but I do know this kind of creative process first hand:<br />
<a title="My music" href="http://soundcloud.com/jack-rock/">When I&#8217;m working on music</a>, I would, for instance, never dream of having a spec!<br />
Instead, what I do is keep my ideas microscopic, then try them out and get something more or less unexpected in return from my machines. Typically, hearing this will spark a new idea in my head, and so in a prolonged, iterative process, I&#8217;ll produce a piece of music in close collaboration with my collection of electronic equipment. The result is completely unknown, until it&#8217;s suddenly deemed finished.</p>
<p>Of course, that kind of uncompromised creative flow is not viable in a business context &#8211; and I&#8217;m sure more commercially successful musical artists than me have some way of sneaking a &#8220;spec&#8221; or a plan into the process in order to keep their productivity high. Inspiration is quite unreliable at times. Any artist will tell you that!</p>
<p>But when it comes to programming, where do we draw the line?<br />
How do we keep control of our productivity, while still keeping our process open to the kind of sudden inspirational insights that fuel innovation?</p>
 <p><a href="http://www.jakobloekkemadsen.com/?flattrss_redirect&amp;id=303&amp;md5=33b68fa29945ccc450709c7a631f09b3" title="Flattr" target="_blank"><img src="http://www.jakobloekkemadsen.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/8dx0ttB7PIg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2012/05/specs-and-creativity/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=jakobloekke&amp;popout=1&amp;url=http%3A%2F%2Fwww.jakobloekkemadsen.com%2F2012%2F05%2Fspecs-and-creativity%2F&amp;language=en_GB&amp;category=text&amp;title=Specs+and+creativity&amp;description=Today+I+became+aware+of+the+existence+of+the+Joel+Test+%26%238211%3B+a+list+of+questions+for+assessing+the+quality+of+a+software+development+team%3A+Do+you+use+source+control%3F...&amp;tags=Code%2CCreative+process%2CMusic%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.jakobloekkemadsen.com/2012/05/specs-and-creativity/</feedburner:origLink></item>
		<item>
		<title>Growing software</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/mMZvRhBOYRY/</link>
		<comments>http://www.jakobloekkemadsen.com/2012/04/growing-software/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 14:00:15 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[craftsmanship]]></category>
		<category><![CDATA[design metaphors]]></category>
		<category><![CDATA[professionalism]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=276</guid>
		<description><![CDATA[<p>Next time you refer to software development as “building” something, there’s a good chance that you’re doing damage to your project.</p>
<p>The construction metaphor is widespread in software and IT, and there are several reasons why:</p>
<ul>
<li>It sounds like you are creating a thing which can be assessed on its’ own in absolute terms &#8211; detached from the social reality of its’ inhabitants or users.</li>
<li>It sounds like you are doing something, which will eventually be finished.</li>
<li>It makes software engineers and architects seem more like “real” engineers and architects.</li>
</ul>
<p>All of this sounds very serious and reassuring to clients.</p>
<p>But the worst threat to problem solving is misunderstanding the nature of the problem.<br />
And software is nothing like buildings!</p>
<ul>
<li>Software is social. Content and data is created by people. Business rules are described and used by people and reflect (and change with) the organization in which they are embedded.</li>
<li>Software is never finished. There’s always a next version, a “phase two”, a redesign, etc. somewhere on the horizon. And if you’re lucky enough to work on agile projects, this flow of re-alignments is even more accellerated.</li>
<li>Job titles in the software industry sometimes seem like they’re meant solely to describe our work in terms our grandmothers can understand. In reality, the titles don’t say much about the nature of the jobs.</li>
</ul>
<h3 id="software_gardener">Software gardener</h3>
<p>Today I stumbled on <a href="http://www.globalnerdy.com/2007/07/18/laws-of-software-development/">this great collection of some of the many, many software development laws</a>.<br />
The author of the post notes that: “<strong>some of the laws come from the world of biology — they also appear in some lists of software laws, and I think they still apply.</strong>”<br />
This observation brilliantly emphasizes why the gardening metaphor (suggested by <a href="http://pragprog.com/the-pragmatic-programmer">Andrew Hunt and David Thomas </a>) suits the art of software development much better than the construction metaphor.</p>
<p>Gardening is about thinking ahead, planning, then waiting patiently and reacting to the ways of nature, nursing, killing bugs and weeds &#8211; and season after season learning from your experience.</p>
<p>Good software is created in the same way: Pre-planning using as many skills as possible, then trying out concepts and ideas in real life, nursing and improving what works and getting rid of what doesn’t &#8211; then going back and doing it again and again.<br />
Good programmers &#8211; like good gardeners &#8211; know when to immerse themselves in little things and when to take a step back and assess the grand perspective. They understand the intimate connection between the singular detail and the ecosystem.</p>
<p>We already talk about &#8220;growing businesses&#8221;, so the concept of growing software shouldn’t be hard to explain to clients or investors.</p>
<p>Btw.: As with any interesting topic, Jeff Atwood has written a quality piece about this over at <a href="http://www.codinghorror.com/blog/2008/11/tending-your-software-garden.html">codinghorror.com</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p>Next time you refer to software development as “building” something, there’s a good chance that you’re doing damage to your project.</p>
<p>The construction metaphor is widespread in software and IT, and there are several reasons why:</p>
<ul>
<li>It sounds like you are creating a thing which can be assessed on its’ own in absolute terms &#8211; detached from the social reality of its’ inhabitants or users.</li>
<li>It sounds like you are doing something, which will eventually be finished.</li>
<li>It makes software engineers and architects seem more like “real” engineers and architects.</li>
</ul>
<p>All of this sounds very serious and reassuring to clients.</p>
<p>But the worst threat to problem solving is misunderstanding the nature of the problem.<br />
And software is nothing like buildings!</p>
<ul>
<li>Software is social. Content and data is created by people. Business rules are described and used by people and reflect (and change with) the organization in which they are embedded.</li>
<li>Software is never finished. There’s always a next version, a “phase two”, a redesign, etc. somewhere on the horizon. And if you’re lucky enough to work on agile projects, this flow of re-alignments is even more accellerated.</li>
<li>Job titles in the software industry sometimes seem like they’re meant solely to describe our work in terms our grandmothers can understand. In reality, the titles don’t say much about the nature of the jobs.</li>
</ul>
<h3 id="software_gardener">Software gardener</h3>
<p>Today I stumbled on <a href="http://www.globalnerdy.com/2007/07/18/laws-of-software-development/">this great collection of some of the many, many software development laws</a>.<br />
The author of the post notes that: “<strong>some of the laws come from the world of biology — they also appear in some lists of software laws, and I think they still apply.</strong>”<br />
This observation brilliantly emphasizes why the gardening metaphor (suggested by <a href="http://pragprog.com/the-pragmatic-programmer">Andrew Hunt and David Thomas </a>) suits the art of software development much better than the construction metaphor.</p>
<p>Gardening is about thinking ahead, planning, then waiting patiently and reacting to the ways of nature, nursing, killing bugs and weeds &#8211; and season after season learning from your experience.</p>
<p>Good software is created in the same way: Pre-planning using as many skills as possible, then trying out concepts and ideas in real life, nursing and improving what works and getting rid of what doesn’t &#8211; then going back and doing it again and again.<br />
Good programmers &#8211; like good gardeners &#8211; know when to immerse themselves in little things and when to take a step back and assess the grand perspective. They understand the intimate connection between the singular detail and the ecosystem.</p>
<p>We already talk about &#8220;growing businesses&#8221;, so the concept of growing software shouldn’t be hard to explain to clients or investors.</p>
<p>Btw.: As with any interesting topic, Jeff Atwood has written a quality piece about this over at <a href="http://www.codinghorror.com/blog/2008/11/tending-your-software-garden.html">codinghorror.com</a>.</p>
 <p><a href="http://www.jakobloekkemadsen.com/?flattrss_redirect&amp;id=276&amp;md5=5b926b8292d2541d2e7e381c53d9b342" title="Flattr" target="_blank"><img src="http://www.jakobloekkemadsen.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/mMZvRhBOYRY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2012/04/growing-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=jakobloekke&amp;popout=1&amp;url=http%3A%2F%2Fwww.jakobloekkemadsen.com%2F2012%2F04%2Fgrowing-software%2F&amp;language=en_GB&amp;category=text&amp;title=Growing+software&amp;description=Next+time+you+refer+to+software+development+as+%E2%80%9Cbuilding%E2%80%9D+something%2C+there%E2%80%99s+a+good+chance+that+you%E2%80%99re+doing+damage+to+your+project.+The+construction+metaphor+is+widespread+in+software+and+IT%2C...&amp;tags=craftsmanship%2Cdesign+metaphors%2Cprofessionalism%2Csoftware%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.jakobloekkemadsen.com/2012/04/growing-software/</feedburner:origLink></item>
		<item>
		<title>Benchmarking the jQuery DOM ready binding</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/YOTdWw8tKkU/</link>
		<comments>http://www.jakobloekkemadsen.com/2012/02/benchmarking-the-jquery-dom-ready-binding/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 11:27:02 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=265</guid>
		<description><![CDATA[<p>After a discussion with a colleague about the pros and cons of using a lot of <strong>$(document).ready(function(){ &#8230; })</strong> statements across a project, I decided to measure the raw performance of the event binding itself.</p>
<p>Both of us agreed that extensive use of this statement represents a sort of <em>code-smell</em> &#8211; that it&#8217;s probably a sign that your Javascript needs better structure &#8211; and that this, in turn, will  probably lead to bad performance in one way or another.</p>
<p>But that set aside, how about the statement itself?<br />
Does it incur a performance hit?</p>
<p>Here&#8217;s the code I used for testing:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> no_of_bindings <span style="color: #339933;">=</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">;</span>
&#160;
<span style="color: #003366; font-weight: bold;">function</span> bind<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> no_of_bindings <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&#62;=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&#160;
console.<span style="color: #660066;">time</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&#34;bindings&#34;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
bind<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">timeEnd</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&#34;bindings&#34;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>For IE, I used <a href="http://getfirebug.com/firebuglite" target="_blank">Firebug Lite</a>, which supports the <code>console.time</code> method.<br />
All times are measured in milliseconds.</p>
<p>And here are the results:</p>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<th class='s0'>
            Number of bindings:
        </th>
<th class='s1'>
            1
        </th>
<th class='s1'>
            10
        </th>
<th class='s1'>
            100
        </th>
<th class='s1'>
            1000
        </th>
<th class='s1'>
            10000
        </th>
<th class='s1'>
            100000
        </th>
<th class='s1'>
            1000000
        </th>
</tr>
<tr>
<td class='s2'>
            Firefox
        </td>
<td class='s3'>
            1
        </td>
<td class='s3'>
            1
        </td>
<td class='s3'>
            5
        </td>
<td class='s3'>
            12
        </td>
<td class='s3'>
            109
        </td>
<td class='s3'>
            1052
        </td>
<td class='s3'>
            4952
        </td>
</tr>
<tr>
<td class='s2'>
            Chrome
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            2
        </td>
<td class='s3'>
            17
        </td>
<td class='s3'>
            160
        </td>
<td class='s3'>
            1936
        </td>
</tr>
<tr>
<td class='s2'>
            IE9
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            2
        </td>
<td class='s3'>
            5
        </td>
<td class='s3'>
            16
        </td>
<td class='s3'>
            140
        </td>
<td class='s3'>
            1831
        </td>
<td class='s3'>
            16866
        </td>
</tr>
<tr>
<td class='s2'>
            Safari
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            1
        </td>
<td class='s3'>
            6
        </td>
<td class='s3'>
            63
        </td>
<td class='s3'>
            872
        </td>
<td class='s3'>
            8739
        </td>
</tr>
</table>
<p>As it turns out, you need to do an absurd amount of bindings before the performance overhead is worth caring about &#8211; even for IE.<br />
It might be different for older browsers, of course, but I didn&#8217;t feel like bothering with measuring those, since the pattern is probably equal + you have loads of other things dragging you down.</p>
<p>So in conclusion: DOM ready bindings are <em>almost</em> free to do, but you should of course still be conscious about why you are using them.</p>
]]></description>
			<content:encoded><![CDATA[<p>After a discussion with a colleague about the pros and cons of using a lot of <strong>$(document).ready(function(){ &#8230; })</strong> statements across a project, I decided to measure the raw performance of the event binding itself.</p>
<p>Both of us agreed that extensive use of this statement represents a sort of <em>code-smell</em> &#8211; that it&#8217;s probably a sign that your Javascript needs better structure &#8211; and that this, in turn, will  probably lead to bad performance in one way or another.</p>
<p>But that set aside, how about the statement itself?<br />
Does it incur a performance hit?</p>
<p>Here&#8217;s the code I used for testing:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> no_of_bindings <span style="color: #339933;">=</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> bind<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> no_of_bindings <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&gt;=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
console.<span style="color: #660066;">time</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;bindings&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
bind<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">timeEnd</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;bindings&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>For IE, I used <a href="http://getfirebug.com/firebuglite" target="_blank">Firebug Lite</a>, which supports the <code>console.time</code> method.<br />
All times are measured in milliseconds.</p>
<p>And here are the results:</p>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<th class='s0'>
            Number of bindings:
        </th>
<th class='s1'>
            1
        </th>
<th class='s1'>
            10
        </th>
<th class='s1'>
            100
        </th>
<th class='s1'>
            1000
        </th>
<th class='s1'>
            10000
        </th>
<th class='s1'>
            100000
        </th>
<th class='s1'>
            1000000
        </th>
</tr>
<tr>
<td class='s2'>
            Firefox
        </td>
<td class='s3'>
            1
        </td>
<td class='s3'>
            1
        </td>
<td class='s3'>
            5
        </td>
<td class='s3'>
            12
        </td>
<td class='s3'>
            109
        </td>
<td class='s3'>
            1052
        </td>
<td class='s3'>
            4952
        </td>
</tr>
<tr>
<td class='s2'>
            Chrome
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            2
        </td>
<td class='s3'>
            17
        </td>
<td class='s3'>
            160
        </td>
<td class='s3'>
            1936
        </td>
</tr>
<tr>
<td class='s2'>
            IE9
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            2
        </td>
<td class='s3'>
            5
        </td>
<td class='s3'>
            16
        </td>
<td class='s3'>
            140
        </td>
<td class='s3'>
            1831
        </td>
<td class='s3'>
            16866
        </td>
</tr>
<tr>
<td class='s2'>
            Safari
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            0
        </td>
<td class='s3'>
            1
        </td>
<td class='s3'>
            6
        </td>
<td class='s3'>
            63
        </td>
<td class='s3'>
            872
        </td>
<td class='s3'>
            8739
        </td>
</tr>
</table>
<p>As it turns out, you need to do an absurd amount of bindings before the performance overhead is worth caring about &#8211; even for IE.<br />
It might be different for older browsers, of course, but I didn&#8217;t feel like bothering with measuring those, since the pattern is probably equal + you have loads of other things dragging you down.</p>
<p>So in conclusion: DOM ready bindings are <em>almost</em> free to do, but you should of course still be conscious about why you are using them.</p>
 <p><a href="http://www.jakobloekkemadsen.com/?flattrss_redirect&amp;id=265&amp;md5=379fc815009c14302ddac7bc1e40293c" title="Flattr" target="_blank"><img src="http://www.jakobloekkemadsen.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/YOTdWw8tKkU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2012/02/benchmarking-the-jquery-dom-ready-binding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=jakobloekke&amp;popout=1&amp;url=http%3A%2F%2Fwww.jakobloekkemadsen.com%2F2012%2F02%2Fbenchmarking-the-jquery-dom-ready-binding%2F&amp;language=en_GB&amp;category=text&amp;title=Benchmarking+the+jQuery+DOM+ready+binding&amp;description=After+a+discussion+with+a+colleague+about+the+pros+and+cons+of+using+a+lot+of+%24%28document%29.ready%28function%28%29%7B+%26%238230%3B+%7D%29+statements+across+a+project%2C+I+decided+to+measure+the+raw+performance...&amp;tags=javascript%2Cperformance%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.jakobloekkemadsen.com/2012/02/benchmarking-the-jquery-dom-ready-binding/</feedburner:origLink></item>
		<item>
		<title>How to use Knockout.js with XSLT</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/AvJ0syES_tU/</link>
		<comments>http://www.jakobloekkemadsen.com/2011/11/how-to-use-knockout-js-with-xslt/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 15:37:37 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[knockout.js]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=246</guid>
		<description><![CDATA[<p>As you may know, <a href="http://knockoutjs.com/">Knockout.js</a> uses inline Javascript for it&#8217;s elegant, declarative bindings:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&#60;</span>li data<span style="color: #339933;">-</span>bind<span style="color: #339933;">=</span><span style="color: #3366CC;">&#34;css: {'active': visible()}&#34;</span><span style="color: #339933;">&#62;&#60;/</span>li<span style="color: #339933;">&#62;</span></pre></div></div>

<p>But if you use XSLT to render your HTML, it may fail because the curly-braces may not be supported in attributes.</p>
<p>To make this work, you need to do two things:</p>
<ol>
<li>
Convert the attribute:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">data<span style="color: #339933;">-</span>bind<span style="color: #339933;">=</span><span style="color: #3366CC;">&#34;...&#34;</span></pre></div></div>

<p> into an</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&#60;</span>xsl<span style="color: #339933;">:</span>attribute <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&#34;data-bind&#34;</span><span style="color: #339933;">&#62;</span></pre></div></div>

<p>Like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&#60;</span>li<span style="color: #339933;">&#62;</span>
 <span style="color: #339933;">&#60;</span>xsl<span style="color: #339933;">:</span>attribute <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&#34;data-bind&#34;</span><span style="color: #339933;">&#62;</span>
  css<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'active'</span><span style="color: #339933;">:</span> visible<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span>
 <span style="color: #339933;">&#60;/</span>xsl<span style="color: #339933;">:</span>attribute<span style="color: #339933;">&#62;</span>
<span style="color: #339933;">&#60;/</span>li<span style="color: #339933;">&#62;</span></pre></div></div>

</li>
<li>Do a search and replace exchanging the curly braces with XML-safe entities:

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	<span style="color: #3366CC;">&#34;{&#34;</span> to <span style="color: #3366CC;">&#34;&#38;#123;&#34;</span>
	<span style="color: #3366CC;">&#34;}&#34;</span> to <span style="color: #3366CC;">&#34;&#38;#125&#34;</span></pre></div></div>

<p>	So the final XSLT should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&#60;</span>li<span style="color: #339933;">&#62;</span>
 <span style="color: #339933;">&#60;</span>xsl<span style="color: #339933;">:</span>attribute <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&#34;data-bind&#34;</span><span style="color: #339933;">&#62;</span>
  css<span style="color: #339933;">:</span> <span style="color: #339933;">&#38;</span>#<span style="color: #CC0000;">125</span><span style="color: #3366CC;">'active'</span><span style="color: #339933;">:</span> visible<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&#38;</span>#<span style="color: #CC0000;">125</span>
 <span style="color: #339933;">&#60;/</span>xsl<span style="color: #339933;">:</span>attribute<span style="color: #339933;">&#62;</span>
<span style="color: #339933;">&#60;/</span>li<span style="color: #339933;">&#62;</span></pre></div></div>

<p>&#160;</li>
</ol>
<p>Ugly, I know! But now it will work.</p>
]]></description>
			<content:encoded><![CDATA[<p>As you may know, <a href="http://knockoutjs.com/">Knockout.js</a> uses inline Javascript for it&#8217;s elegant, declarative bindings:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>li data<span style="color: #339933;">-</span>bind<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;css: {'active': visible()}&quot;</span><span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span></pre></div></div>

<p>But if you use XSLT to render your HTML, it may fail because the curly-braces may not be supported in attributes.</p>
<p>To make this work, you need to do two things:</p>
<ol>
<li>
Convert the attribute:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">data<span style="color: #339933;">-</span>bind<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;...&quot;</span></pre></div></div>

<p> into an</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>xsl<span style="color: #339933;">:</span>attribute <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;data-bind&quot;</span><span style="color: #339933;">&gt;</span></pre></div></div>

<p>Like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span>
 <span style="color: #339933;">&lt;</span>xsl<span style="color: #339933;">:</span>attribute <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;data-bind&quot;</span><span style="color: #339933;">&gt;</span>
  css<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'active'</span><span style="color: #339933;">:</span> visible<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span>
 <span style="color: #339933;">&lt;/</span>xsl<span style="color: #339933;">:</span>attribute<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span></pre></div></div>

</li>
<li>Do a search and replace exchanging the curly braces with XML-safe entities:

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	<span style="color: #3366CC;">&quot;{&quot;</span> to <span style="color: #3366CC;">&quot;&amp;#123;&quot;</span>
	<span style="color: #3366CC;">&quot;}&quot;</span> to <span style="color: #3366CC;">&quot;&amp;#125&quot;</span></pre></div></div>

<p>	So the final XSLT should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span>
 <span style="color: #339933;">&lt;</span>xsl<span style="color: #339933;">:</span>attribute <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;data-bind&quot;</span><span style="color: #339933;">&gt;</span>
  css<span style="color: #339933;">:</span> <span style="color: #339933;">&amp;</span>#<span style="color: #CC0000;">125</span><span style="color: #3366CC;">'active'</span><span style="color: #339933;">:</span> visible<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;</span>#<span style="color: #CC0000;">125</span>
 <span style="color: #339933;">&lt;/</span>xsl<span style="color: #339933;">:</span>attribute<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span></pre></div></div>

<p>&nbsp;</li>
</ol>
<p>Ugly, I know! But now it will work.</p>
 <p><a href="http://www.jakobloekkemadsen.com/?flattrss_redirect&amp;id=246&amp;md5=74ecaada9236982fabf4c4b98325ee38" title="Flattr" target="_blank"><img src="http://www.jakobloekkemadsen.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/AvJ0syES_tU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2011/11/how-to-use-knockout-js-with-xslt/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=jakobloekke&amp;popout=1&amp;url=http%3A%2F%2Fwww.jakobloekkemadsen.com%2F2011%2F11%2Fhow-to-use-knockout-js-with-xslt%2F&amp;language=en_GB&amp;category=text&amp;title=How+to+use+Knockout.js+with+XSLT&amp;description=As+you+may+know%2C+Knockout.js+uses+inline+Javascript+for+it%26%238217%3Bs+elegant%2C+declarative+bindings%3A+%26lt%3Bli+data-bind%3D%26quot%3Bcss%3A+%7B%27active%27%3A+visible%28%29%7D%26quot%3B%26gt%3B%26lt%3B%2Fli%26gt%3B+But+if+you+use+XSLT+to+render+your+HTML%2C+it+may+fail+because...&amp;tags=javascript%2Cknockout.js%2Cxslt%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.jakobloekkemadsen.com/2011/11/how-to-use-knockout-js-with-xslt/</feedburner:origLink></item>
		<item>
		<title>DropCheck: A magic checklist using Dropbox and Knockout.js</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/C562LWrlvP8/</link>
		<comments>http://www.jakobloekkemadsen.com/2011/09/dropcheck-a-magic-checklist-using-dropbox-and-knockout-js/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 21:27:37 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[knockout.js]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=201</guid>
		<description><![CDATA[<p>Ever created a todo list in a .txt file, then popped it into Dropbox for iPhone viewing?</p>
<p>I do it all the time! That&#8217;s why I created <strong><a title="Download DropCheck" onclick="pageTracker._trackEvent('link', 'click', 'DropCheck download');" href="https://github.com/jakobloekke/Dropcheck/zipball/master">DropCheck</a></strong>.</p>
<p>&#160;</p>
<p><a title="Download DropCheck" onclick="pageTracker._trackEvent('link', 'click', 'DropCheck download');" href="https://github.com/jakobloekke/Dropcheck/zipball/master"><img class="alignnone size-full wp-image-231" title="dropcheck" src="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/09/dropcheck1.png" alt="DropCheck" width="500" height="376" /></a></p>
<p><strong>DropCheck is a web app that turns lines in a .txt file into checkable lines in a nice web app interface.</strong></p>
<p>It&#8217;s tailored specifically for grocery shopping, as this is a common use case for me.<br />
You have the ability to tick off each item as it goes in your shopping cart (&#8220;Yes&#8221;).<br />
Or you can mark it as sold out (&#8220;No&#8221;).</p>
<p>At the bottom you can move the checked items to the bottom of the list, so you have them out of sight.<br />
The web app also remembers the state of the list even though you close it.<br />
To re-connect to the Dropbox .txt-file you just click the &#8220;Reset to Dropbox file&#8221; link.</p>
<h3>Installation:</h3>
<p>To install, unzip the <strong><a title="Download DropCheck" onclick="pageTracker._trackEvent('link', 'click', 'DropCheck download');" href="https://github.com/jakobloekke/Dropcheck/zipball/master">DropCheck folder</a></strong> into your Dropbox public folder, then get the public link of the file called <code>dropcheck.htm</code>:<br />
<img class="alignnone size-full wp-image-211" title="Skærmbillede 2011-09-20 kl. 22.52.02" src="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/09/Skærmbillede-2011-09-20-kl.-22.52.02.png" alt="" width="563" height="185" /></p>
<p>&#160;</p>
<p>Visit the public URL in Safari on your iPhone and save it to your homescreen:</p>
<p><img class="alignnone size-medium wp-image-213" title="installDropCheck" src="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/09/installDropCheck1-200x300.png" alt="" width="200" height="300" />    <img class="alignnone size-full wp-image-215" title="icon" src="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/09/icon.png" alt="" width="89" height="97" /></p>
<p>&#160;</p>
<p><strong>Now, when you visit the DropCheck app, you&#8217;ll see the contents of the <code>dropcheck-list.txt</code> file turned into a checkable list.</strong></p>
<p>Enjoy!</p>
<p>&#160;</p>
<p><strong>UPDATE for Windows users:</strong></p>
<p><a title="Kasper Hyllested" href="http://www.hyllested.net/">Kasper Hyllested</a> pointed out to me, that there was an issue with international characters when saving the .txt-file from Notepad on Windows.</p>
<p>To fix this, you must force notepad to save using UTF-8 encoding of characters (instead of ANSI):</p>
<p><img class="alignnone size-full wp-image-238" title="Skærmbillede-2011-09-22-kl.-09.37.21" src="http://www.jakobloekkemadsen.com/slir/w580/wp-content/uploads/2011/09/Skærmbillede-2011-09-22-kl.-09.37.21.png" alt="" /></p>
]]></description>
			<content:encoded><![CDATA[<p>Ever created a todo list in a .txt file, then popped it into Dropbox for iPhone viewing?</p>
<p>I do it all the time! That&#8217;s why I created <strong><a title="Download DropCheck" onclick="pageTracker._trackEvent('link', 'click', 'DropCheck download');" href="https://github.com/jakobloekke/Dropcheck/zipball/master">DropCheck</a></strong>.</p>
<p>&nbsp;</p>
<p><a title="Download DropCheck" onclick="pageTracker._trackEvent('link', 'click', 'DropCheck download');" href="https://github.com/jakobloekke/Dropcheck/zipball/master"><img class="alignnone size-full wp-image-231" title="dropcheck" src="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/09/dropcheck1.png" alt="DropCheck" width="500" height="376" /></a></p>
<p><strong>DropCheck is a web app that turns lines in a .txt file into checkable lines in a nice web app interface.</strong></p>
<p>It&#8217;s tailored specifically for grocery shopping, as this is a common use case for me.<br />
You have the ability to tick off each item as it goes in your shopping cart (&#8220;Yes&#8221;).<br />
Or you can mark it as sold out (&#8220;No&#8221;).</p>
<p>At the bottom you can move the checked items to the bottom of the list, so you have them out of sight.<br />
The web app also remembers the state of the list even though you close it.<br />
To re-connect to the Dropbox .txt-file you just click the &#8220;Reset to Dropbox file&#8221; link.</p>
<h3>Installation:</h3>
<p>To install, unzip the <strong><a title="Download DropCheck" onclick="pageTracker._trackEvent('link', 'click', 'DropCheck download');" href="https://github.com/jakobloekke/Dropcheck/zipball/master">DropCheck folder</a></strong> into your Dropbox public folder, then get the public link of the file called <code>dropcheck.htm</code>:<br />
<img class="alignnone size-full wp-image-211" title="Skærmbillede 2011-09-20 kl. 22.52.02" src="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/09/Skærmbillede-2011-09-20-kl.-22.52.02.png" alt="" width="563" height="185" /></p>
<p>&nbsp;</p>
<p>Visit the public URL in Safari on your iPhone and save it to your homescreen:</p>
<p><img class="alignnone size-medium wp-image-213" title="installDropCheck" src="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/09/installDropCheck1-200x300.png" alt="" width="200" height="300" />    <img class="alignnone size-full wp-image-215" title="icon" src="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/09/icon.png" alt="" width="89" height="97" /></p>
<p>&nbsp;</p>
<p><strong>Now, when you visit the DropCheck app, you&#8217;ll see the contents of the <code>dropcheck-list.txt</code> file turned into a checkable list.</strong></p>
<p>Enjoy!</p>
<p>&nbsp;</p>
<p><strong>UPDATE for Windows users:</strong></p>
<p><a title="Kasper Hyllested" href="http://www.hyllested.net/">Kasper Hyllested</a> pointed out to me, that there was an issue with international characters when saving the .txt-file from Notepad on Windows.</p>
<p>To fix this, you must force notepad to save using UTF-8 encoding of characters (instead of ANSI):</p>
<p><img class="alignnone size-full wp-image-238" title="Skærmbillede-2011-09-22-kl.-09.37.21" src="http://www.jakobloekkemadsen.com/slir/w580/wp-content/uploads/2011/09/Skærmbillede-2011-09-22-kl.-09.37.21.png" alt="" /></p>
 <p><a href="http://www.jakobloekkemadsen.com/?flattrss_redirect&amp;id=201&amp;md5=6f9f5da6ae47bf0a6330216714daedbe" title="Flattr" target="_blank"><img src="http://www.jakobloekkemadsen.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/C562LWrlvP8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2011/09/dropcheck-a-magic-checklist-using-dropbox-and-knockout-js/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=jakobloekke&amp;popout=1&amp;url=http%3A%2F%2Fwww.jakobloekkemadsen.com%2F2011%2F09%2Fdropcheck-a-magic-checklist-using-dropbox-and-knockout-js%2F&amp;language=en_GB&amp;category=text&amp;title=DropCheck%3A+A+magic+checklist+using+Dropbox+and+Knockout.js&amp;description=Ever+created+a+todo+list+in+a+.txt+file%2C+then+popped+it+into+Dropbox+for+iPhone+viewing%3F+I+do+it+all+the+time%21%C2%A0That%26%238217%3Bs+why+I+created+DropCheck.+%26nbsp%3B+DropCheck+is...&amp;tags=dropbox%2Chtml5%2Ciphone%2Cjavascript%2Cknockout.js%2Cwebapp%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.jakobloekkemadsen.com/2011/09/dropcheck-a-magic-checklist-using-dropbox-and-knockout-js/</feedburner:origLink></item>
		<item>
		<title>How to make CSS3PIE work</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/Zb1Z16Fh8hk/</link>
		<comments>http://www.jakobloekkemadsen.com/2010/10/how-to-make-css3pie-work/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 19:16:45 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Frontend development]]></category>
		<category><![CDATA[htc]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=172</guid>
		<description><![CDATA[<p><a href="http://css3pie.com" target="_blank"><img class="alignnone" title="CSS3pie" src="http://css3pie.com/wp/wp-content/themes/pie-wp-theme/img/logo.png" alt="CSS3pie" width="194" height="127" /></a></p>
<p>Countless hours have been lost creating rounded corners, dropshadows and gradient backgrounds for the web.<br />
With Internet Explorer still lacking support for CSS3, until recently it seemed like we would have to keep doing tiny graphic sprites (or implementing dirty javascripts) in order to accomodate the demand for such UI niceness.</p>
<p>Enter: <a href="http://css3pie.com/" target="_blank">http://css3pie.com/</a><br />
PIE is a .htc CSS behaviour script that enables support for dropshadows, rounded corners and background gradient CSS3 properties in Internet Explorer &#8211; all the way back to IE6!</p>
<p>Of course, I couldn&#8217;t wait to try it out.<br />
And it didn&#8217;t work.<br />
Bummer &#8230;</p>
<p>Fortunately, I found out why:<br />
It only works on positioned elements.</p>
<p><strong>You must specify &#8220;position: relative;&#8221; or &#8220;position: absolute;&#8221; on the element that calls the .htc behaviour, and then it works!</strong></p>
<p>Amazing script!<br />
CSS3 future is here now.<br />
Thank you so much, Jason Johnston of <a href="http://327creative.com/" target="_blank">327 Creative LLC</a>, for sharing this little goodie with the world!</p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://css3pie.com" target="_blank"><img class="alignnone" title="CSS3pie" src="http://css3pie.com/wp/wp-content/themes/pie-wp-theme/img/logo.png" alt="CSS3pie" width="194" height="127" /></a></p>
<p>Countless hours have been lost creating rounded corners, dropshadows and gradient backgrounds for the web.<br />
With Internet Explorer still lacking support for CSS3, until recently it seemed like we would have to keep doing tiny graphic sprites (or implementing dirty javascripts) in order to accomodate the demand for such UI niceness.</p>
<p>Enter: <a href="http://css3pie.com/" target="_blank">http://css3pie.com/</a><br />
PIE is a .htc CSS behaviour script that enables support for dropshadows, rounded corners and background gradient CSS3 properties in Internet Explorer &#8211; all the way back to IE6!</p>
<p>Of course, I couldn&#8217;t wait to try it out.<br />
And it didn&#8217;t work.<br />
Bummer &#8230;</p>
<p>Fortunately, I found out why:<br />
It only works on positioned elements.</p>
<p><strong>You must specify &#8220;position: relative;&#8221; or &#8220;position: absolute;&#8221; on the element that calls the .htc behaviour, and then it works!</strong></p>
<p>Amazing script!<br />
CSS3 future is here now.<br />
Thank you so much, Jason Johnston of <a href="http://327creative.com/" target="_blank">327 Creative LLC</a>, for sharing this little goodie with the world!</p>
 <p><a href="http://www.jakobloekkemadsen.com/?flattrss_redirect&amp;id=172&amp;md5=5285f6c0ac74e5dc326e065ee81c973e" title="Flattr" target="_blank"><img src="http://www.jakobloekkemadsen.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/Zb1Z16Fh8hk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2010/10/how-to-make-css3pie-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=jakobloekke&amp;popout=1&amp;url=http%3A%2F%2Fwww.jakobloekkemadsen.com%2F2010%2F10%2Fhow-to-make-css3pie-work%2F&amp;language=en_GB&amp;category=text&amp;title=How+to+make+CSS3PIE+work&amp;description=Countless+hours+have+been+lost+creating+rounded+corners%2C+dropshadows+and+gradient+backgrounds+for+the+web.+With+Internet+Explorer+still+lacking+support+for+CSS3%2C+until+recently+it+seemed+like+we+would...&amp;tags=css%2Ccss3%2CFrontend+development%2Chtc%2CIE6%2CIE7%2CIE8%2CInternet+Explorer%2CUI%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/10/how-to-make-css3pie-work/</feedburner:origLink></item>
		<item>
		<title>Useful PHP libraries, part 2 – Scaffold CSS</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/hUxRzXF1WyQ/</link>
		<comments>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-2-scaffold-css/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 16:52:24 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[clean code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=150</guid>
		<description><![CDATA[<p><strong>NOTE: This post describes a library which has been discontinued. These days I use <a href="http://sass-lang.com/" title="SASS">SASS</a> instead.</strong></p>
<p><a href="http://wiki.github.com/anthonyshort/csscaffold/" target="_blank">Scaffold CSS</a> was developed by <a href="http://anthonyshort.com.au/" target="_blank">Anthony Short</a> and it is every CSS-coder’s dream come true:</p>
<p>Variables, nested selectors, abstractions from vendor-specific properties etc. etc. etc. Good stuff!</p>
<p>Installation and usage couldn’t be simpler! (Really. I don’t see how it could!)<br />
You place the library folder in whatever folder holds you CSS-files. Then you copy-paste the .htaccess-file that redirects every request for your CSS-files to the library. Scaffold then reads through your CSS and interprets whatever tricks you’ve written and serves up nicely formatted (or minifed, if you prefer) W3C-compliant CSS.</p>
<p>”What’s this good for?”, you say?</p>
<p>Well. Consider this piece of regular CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span><span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#departure_date</span><span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#persons</span><span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#location</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span> label<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#departure_date</span> label<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#persons</span> label<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#location</span> label
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span> input<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#departure_date</span> input<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#persons</span> input<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#location</span> input
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
-moz-box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
-webkit-box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
-ms-box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
behavior<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&#34;boxsizing.htc&#34;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span> .popupcalendar_icon<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span>  <span style="color: #cc00cc;">#departure_date</span> .popupcalendar_icon<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span>  <span style="color: #cc00cc;">#persons</span> .popupcalendar_icon<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span>  <span style="color: #cc00cc;">#location</span> <span style="color: #6666ff;">.popupcalendar_icon</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">./graphics/images/sprites.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">295px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">314px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-271px</span> <span style="color: #933;">-20px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">39px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">31px</span><span style="color: #00AA00;">;</span>
zoom<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -moz-inline-box<span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Even though it’s nicely ordered and very readable, this code is still quite hard to understand at first look. You can&#8217;t just read what&#8217;s going on. What&#8217;s related to what? You need to look back and forth a few times to see this.<br />
This makes it bad code!<br />
<a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882" target="_blank" title="Clean Code - book on amazon">Good code is always easy to read and understand.</a></p>
<p>Now look at the same code in Scaffold syntax:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@constants {</span>
   labelTextColor<span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
   gutter<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&#160;
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #00AA00;">&#123;</span>
&#160;
   <span style="color: #cc00cc;">#arrival_date</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#departure_date</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#persons</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#location</span>  <span style="color: #00AA00;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
      <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> !labelTextColor<span style="color: #00AA00;">;</span>
      <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">2</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
&#160;
      label <span style="color: #00AA00;">&#123;</span>
         <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">10</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
         <span style="color: #00AA00;">+</span>inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
      <span style="color: #00AA00;">&#125;</span>
&#160;
      input <span style="color: #00AA00;">&#123;</span>
         <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">4</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">1</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
         <span style="color: #00AA00;">+</span>border-box<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
      <span style="color: #00AA00;">&#125;</span>
&#160;
      <span style="color: #6666ff;">.popupcalendar_icon</span> <span style="color: #00AA00;">&#123;</span>
         image-replace<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'./graphics/images/sprites.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-271px</span> <span style="color: #933;">-20px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">39px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">31px</span><span style="color: #00AA00;">;</span>
         <span style="color: #00AA00;">+</span>inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
      <span style="color: #00AA00;">&#125;</span>
   <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The nesting immedietaly makes the code easy to read!<br />
The selectors come in a logical order. The code is scannable, and in my opinion this is quite a revolution as far as CSS goes!</p>
<p>And it gets even better!</p>
<p>As you may have noticed, my second code example is full of non-CSS properties.<br />
These are Scaffold-specific functions, constants and ”mixins”.</p>
<p>For example: A standard gutter width of 10px is defined as a constant, then used throughout the style declarations by reference.<br />
No more search-and-replace for simple color changes!<br />
This feature alone will save me countless hours.</p>
<p>Then there’s stuff like ”+inline-block();” or ”+border-box();”. These are ”mixins” that basically call a set of CSS properties that take care of crossbrowser compatibility. Scaffold serves up vendor-specific properties and even a selection of IE-behaviors, filters and expressions to get the desired effect working all around. Now we have a one line trick that’ll fix box model-quirks or get inline-blocks behave like expected. (Or rotation, shadows and other CSS3-goodies for that matter). This means more time for coffee, which is nice!</p>
<p>Finally we have functions like ”image-replace: url(&#8216;./graphics/images/sprites.png&#8217;);”<br />
This line takes care of everything regarding CSS image replacement. It even automatically sets the correct height and width fitting the specified image file.</p>
<p>The library has tons of useful features and some pretty advanced ones too. Everything is cached, so it&#8217;s just as fast as regular CSS. </p>
<p>So if you’re lucky enough to have your CSS-files served from an Apache server with PHP enabled, then by all means, do not miss out on Scaffold CSS!</p>
]]></description>
			<content:encoded><![CDATA[<p><strong>NOTE: This post describes a library which has been discontinued. These days I use <a href="http://sass-lang.com/" title="SASS">SASS</a> instead.</strong></p>
<p><a href="http://wiki.github.com/anthonyshort/csscaffold/" target="_blank">Scaffold CSS</a> was developed by <a href="http://anthonyshort.com.au/" target="_blank">Anthony Short</a> and it is every CSS-coder’s dream come true:</p>
<p>Variables, nested selectors, abstractions from vendor-specific properties etc. etc. etc. Good stuff!</p>
<p>Installation and usage couldn’t be simpler! (Really. I don’t see how it could!)<br />
You place the library folder in whatever folder holds you CSS-files. Then you copy-paste the .htaccess-file that redirects every request for your CSS-files to the library. Scaffold then reads through your CSS and interprets whatever tricks you’ve written and serves up nicely formatted (or minifed, if you prefer) W3C-compliant CSS.</p>
<p>”What’s this good for?”, you say?</p>
<p>Well. Consider this piece of regular CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span><span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#departure_date</span><span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#persons</span><span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#location</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span> label<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#departure_date</span> label<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#persons</span> label<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#location</span> label
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span> input<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#departure_date</span> input<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#persons</span> input<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#location</span> input
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
-moz-box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
-webkit-box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
-ms-box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span>
behavior<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;boxsizing.htc&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #cc00cc;">#arrival_date</span> .popupcalendar_icon<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span>  <span style="color: #cc00cc;">#departure_date</span> .popupcalendar_icon<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span>  <span style="color: #cc00cc;">#persons</span> .popupcalendar_icon<span style="color: #00AA00;">,</span>
form<span style="color: #cc00cc;">#searchbox</span>  <span style="color: #cc00cc;">#location</span> <span style="color: #6666ff;">.popupcalendar_icon</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">./graphics/images/sprites.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">295px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">314px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-271px</span> <span style="color: #933;">-20px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">39px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">31px</span><span style="color: #00AA00;">;</span>
zoom<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -moz-inline-box<span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Even though it’s nicely ordered and very readable, this code is still quite hard to understand at first look. You can&#8217;t just read what&#8217;s going on. What&#8217;s related to what? You need to look back and forth a few times to see this.<br />
This makes it bad code!<br />
<a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882" target="_blank" title="Clean Code - book on amazon">Good code is always easy to read and understand.</a></p>
<p>Now look at the same code in Scaffold syntax:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@constants {</span>
   labelTextColor<span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
   gutter<span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
form<span style="color: #cc00cc;">#searchbox</span> <span style="color: #00AA00;">&#123;</span>
&nbsp;
   <span style="color: #cc00cc;">#arrival_date</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#departure_date</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#persons</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#location</span>  <span style="color: #00AA00;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
      <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> !labelTextColor<span style="color: #00AA00;">;</span>
      <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">2</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
&nbsp;
      label <span style="color: #00AA00;">&#123;</span>
         <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">10</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
         <span style="color: #00AA00;">+</span>inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
      <span style="color: #00AA00;">&#125;</span>
&nbsp;
      input <span style="color: #00AA00;">&#123;</span>
         <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">4</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> #<span style="color: #00AA00;">&#91;</span><span style="color: #cc66cc;">1</span> <span style="color: #00AA00;">*</span> !gutter<span style="color: #00AA00;">&#93;</span><span style="color: #993333;">px</span><span style="color: #00AA00;">;</span>
         <span style="color: #00AA00;">+</span>border-box<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
      <span style="color: #00AA00;">&#125;</span>
&nbsp;
      <span style="color: #6666ff;">.popupcalendar_icon</span> <span style="color: #00AA00;">&#123;</span>
         image-replace<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'./graphics/images/sprites.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-271px</span> <span style="color: #933;">-20px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">39px</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">31px</span><span style="color: #00AA00;">;</span>
         <span style="color: #00AA00;">+</span>inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
         <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
      <span style="color: #00AA00;">&#125;</span>
   <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The nesting immedietaly makes the code easy to read!<br />
The selectors come in a logical order. The code is scannable, and in my opinion this is quite a revolution as far as CSS goes!</p>
<p>And it gets even better!</p>
<p>As you may have noticed, my second code example is full of non-CSS properties.<br />
These are Scaffold-specific functions, constants and ”mixins”.</p>
<p>For example: A standard gutter width of 10px is defined as a constant, then used throughout the style declarations by reference.<br />
No more search-and-replace for simple color changes!<br />
This feature alone will save me countless hours.</p>
<p>Then there’s stuff like ”+inline-block();” or ”+border-box();”. These are ”mixins” that basically call a set of CSS properties that take care of crossbrowser compatibility. Scaffold serves up vendor-specific properties and even a selection of IE-behaviors, filters and expressions to get the desired effect working all around. Now we have a one line trick that’ll fix box model-quirks or get inline-blocks behave like expected. (Or rotation, shadows and other CSS3-goodies for that matter). This means more time for coffee, which is nice!</p>
<p>Finally we have functions like ”image-replace: url(&#8216;./graphics/images/sprites.png&#8217;);”<br />
This line takes care of everything regarding CSS image replacement. It even automatically sets the correct height and width fitting the specified image file.</p>
<p>The library has tons of useful features and some pretty advanced ones too. Everything is cached, so it&#8217;s just as fast as regular CSS. </p>
<p>So if you’re lucky enough to have your CSS-files served from an Apache server with PHP enabled, then by all means, do not miss out on Scaffold CSS!</p>
 <p><a href="http://www.jakobloekkemadsen.com/?flattrss_redirect&amp;id=150&amp;md5=8b5262a748ea252cf8ea8564a87943ab" title="Flattr" target="_blank"><img src="http://www.jakobloekkemadsen.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/hUxRzXF1WyQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-2-scaffold-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=jakobloekke&amp;popout=1&amp;url=http%3A%2F%2Fwww.jakobloekkemadsen.com%2F2010%2F02%2Fuseful-php-libraries-part-2-scaffold-css%2F&amp;language=en_GB&amp;category=text&amp;title=Useful+PHP+libraries%2C+part+2+%26%238211%3B+Scaffold+CSS&amp;description=NOTE%3A+This+post+describes+a+library+which+has+been+discontinued.+These+days+I+use+SASS+instead.+Scaffold+CSS+was+developed+by+Anthony+Short+and+it+is+every+CSS-coder%E2%80%99s+dream+come...&amp;tags=clean+code%2Ccss%2Cphp%2Cproductivity%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-2-scaffold-css/</feedburner:origLink></item>
		<item>
		<title>Useful PHP libraries, part 1 – SLIR</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/W6D-EmN-hcw/</link>
		<comments>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-1-slir/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 19:20:05 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=115</guid>
		<description><![CDATA[<p><em>In this series of blog posts I introduce my favourite PHP libraries.</em></p>
<p>Today&#8217;s library is:<br />
<strong><a href="http://code.google.com/p/smart-lencioni-image-resizer/">SLIR</a></strong></p>
<p>SLIR – or ”Smart Lencioni Image Resizer” – was developed by <a href="http://shiftingpixel.com/">Joe Lencioni</a>.<br />
It does on-the-fly scaling and cropping of images.</p>
<p>The benefit is that you can change your image sizes dynamically on request-time.<br />
If your page layout changes, you can just request images with new sizes that fit.</p>
<p>Under the hood it&#8217;s a clever PHP script that returns the content of an image file. Requests are handled by a .htaccess-file that disguises the underlying PHP and presents it to the public as an actual image file.</p>
<p>This means you activate the resizer just by requesting a url with some resize parameters plus the path to the original image file.</p>
<p>Example:</p>
<p>Original image:</p>

<div class="wp_syntax"><div class="code"><pre class="htm" style="font-family:monospace;">&#60;img src=&#34;http://www.jakobloekkemadsen.com/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg&#34; alt=&#34;&#34; /&#62;</pre></div></div>

<p><img src="http://www.jakobloekkemadsen.com/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg" alt="" /></p>
<p>Scaled to fit 100px width:</p>

<div class="wp_syntax"><div class="code"><pre class="htm" style="font-family:monospace;">&#60;img src=&#34;http://www.jakobloekkemadsen.com/slir/w100/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg&#34; alt=&#34;&#34; /&#62;</pre></div></div>

<p><img src="http://www.jakobloekkemadsen.com/slir/w100/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg" alt="" /></p>
<p>Scaled to fit 25px width and cropped to square:</p>

<div class="wp_syntax"><div class="code"><pre class="htm" style="font-family:monospace;">&#60;img src=&#34;http://www.jakobloekkemadsen.com/slir/w25-c1:1/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg&#34; alt=&#34;&#34; /&#62;</pre></div></div>

<p><img src="http://www.jakobloekkemadsen.com/slir/w25-c1:1/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg" alt="" /></p>
<p>”What about performance?”, I hear you ask. &#8220;Won&#8217;t the server choke on having to process all image requests?&#8221;</p>
<p>No, it won&#8217;t. (-:<br />
SLIR caches the image the first time it’s requested, so all subsequent requests are served just as fast as any other image file on the server. The redirect is handled by an alias to the cachefile. Only if no matching cache file exists, or if it’s too old, or if the original has changed, then SLIR is invoked and a new image is generated and cached.</p>
<p>”Ok. But what about security, then?”</p>
<p>In theory this script enables a hacker to flood your server with files just by changing the url and requesting all imaginable combinations of width and height. This issue has been discussed in the comments on <a href="http://shiftingpixel.com/2008/03/03/smart-image-resizer/">http://shiftingpixel.com/2008/03/03/smart-image-resizer/</a> and the current version of the script can be made to restrict access to any other combinations than the ones you specify.</p>
<p>Personally I haven’t found an easier, more futureproof and flexible solution for handling image scaling.<br />
And it&#8217;s free!</p>
<p>Simply put: I love this script!</p>
<p><strong>Stay tuned for part two of &#8220;Useful PHP libraries&#8221;. Coming soon &#8230;</strong></p>
]]></description>
			<content:encoded><![CDATA[<p><em>In this series of blog posts I introduce my favourite PHP libraries.</em></p>
<p>Today&#8217;s library is:<br />
<strong><a href="http://code.google.com/p/smart-lencioni-image-resizer/">SLIR</a></strong></p>
<p>SLIR – or ”Smart Lencioni Image Resizer” – was developed by <a href="http://shiftingpixel.com/">Joe Lencioni</a>.<br />
It does on-the-fly scaling and cropping of images.</p>
<p>The benefit is that you can change your image sizes dynamically on request-time.<br />
If your page layout changes, you can just request images with new sizes that fit.</p>
<p>Under the hood it&#8217;s a clever PHP script that returns the content of an image file. Requests are handled by a .htaccess-file that disguises the underlying PHP and presents it to the public as an actual image file.</p>
<p>This means you activate the resizer just by requesting a url with some resize parameters plus the path to the original image file.</p>
<p>Example:</p>
<p>Original image:</p>

<div class="wp_syntax"><div class="code"><pre class="htm" style="font-family:monospace;">&lt;img src=&quot;http://www.jakobloekkemadsen.com/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg&quot; alt=&quot;&quot; /&gt;</pre></div></div>

<p><img src="http://www.jakobloekkemadsen.com/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg" alt="" /></p>
<p>Scaled to fit 100px width:</p>

<div class="wp_syntax"><div class="code"><pre class="htm" style="font-family:monospace;">&lt;img src=&quot;http://www.jakobloekkemadsen.com/slir/w100/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg&quot; alt=&quot;&quot; /&gt;</pre></div></div>

<p><img src="http://www.jakobloekkemadsen.com/slir/w100/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg" alt="" /></p>
<p>Scaled to fit 25px width and cropped to square:</p>

<div class="wp_syntax"><div class="code"><pre class="htm" style="font-family:monospace;">&lt;img src=&quot;http://www.jakobloekkemadsen.com/slir/w25-c1:1/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg&quot; alt=&quot;&quot; /&gt;</pre></div></div>

<p><img src="http://www.jakobloekkemadsen.com/slir/w25-c1:1/wp-content/uploads/2010/02/DSC_1225_maj-30-2009.jpg" alt="" /></p>
<p>”What about performance?”, I hear you ask. &#8220;Won&#8217;t the server choke on having to process all image requests?&#8221;</p>
<p>No, it won&#8217;t. (-:<br />
SLIR caches the image the first time it’s requested, so all subsequent requests are served just as fast as any other image file on the server. The redirect is handled by an alias to the cachefile. Only if no matching cache file exists, or if it’s too old, or if the original has changed, then SLIR is invoked and a new image is generated and cached.</p>
<p>”Ok. But what about security, then?”</p>
<p>In theory this script enables a hacker to flood your server with files just by changing the url and requesting all imaginable combinations of width and height. This issue has been discussed in the comments on <a href="http://shiftingpixel.com/2008/03/03/smart-image-resizer/">http://shiftingpixel.com/2008/03/03/smart-image-resizer/</a> and the current version of the script can be made to restrict access to any other combinations than the ones you specify.</p>
<p>Personally I haven’t found an easier, more futureproof and flexible solution for handling image scaling.<br />
And it&#8217;s free!</p>
<p>Simply put: I love this script!</p>
<p><strong>Stay tuned for part two of &#8220;Useful PHP libraries&#8221;. Coming soon &#8230;</strong></p>
 <p><a href="http://www.jakobloekkemadsen.com/?flattrss_redirect&amp;id=115&amp;md5=22fc482b916b1349568bb3054097a086" title="Flattr" target="_blank"><img src="http://www.jakobloekkemadsen.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/W6D-EmN-hcw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-1-slir/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=jakobloekke&amp;popout=1&amp;url=http%3A%2F%2Fwww.jakobloekkemadsen.com%2F2010%2F02%2Fuseful-php-libraries-part-1-slir%2F&amp;language=en_GB&amp;category=text&amp;title=Useful+PHP+libraries%2C+part+1+%26%238211%3B+SLIR&amp;description=In+this+series+of+blog+posts+I+introduce+my+favourite+PHP+libraries.+Today%26%238217%3Bs+library+is%3A+SLIR+SLIR+%E2%80%93+or+%E2%80%9DSmart+Lencioni+Image+Resizer%E2%80%9D+%E2%80%93+was+developed+by+Joe+Lencioni.+It...&amp;tags=class%2Cdesign%2Cimages%2Cphp%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-1-slir/</feedburner:origLink></item>
		<item>
		<title>What’s with the painting?</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/VmyrUeu1rBQ/</link>
		<comments>http://www.jakobloekkemadsen.com/2010/01/whats-with-the-painting/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 17:11:35 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Albrecht Dührer]]></category>
		<category><![CDATA[german artist]]></category>
		<category><![CDATA[intertextuality]]></category>
		<category><![CDATA[painting]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=103</guid>
		<description><![CDATA[<p><strong>Edit: At the time of writing, the Albrecth Dührer painting was used in the design of this site.<br />
This has been changed since. </strong></p>
<p>The background painting on this page is by the German painter Albrecht Dürer (1471 – 1528).</p>
<p>It’s from 1503 and the title of the painting is ”Das große Rasenstück” or ”The Large Turf”.</p>
<p>I decided that I wanted a real painting for the background, so I browsed around the web, came across this one and loved it instantly. It has amazing details in both color and perspective. And the colors made a nice palette for the rest of my design.</p>
<p>Considering the paintings&#8217; year of origin, it’s incredibly modern looking!</p>
<p>It does have this special pre-renaissance or late medieval feel about it, though (those who read Foucault – ”The order of things” will probaby know what I mean). There’s something about the way the whole setting is illuminated that gives it a magical edge.</p>
<p>Here are some more pictures by Dürer:</p>
<p>&#8220;Porträt Albrecht Dürer der Ältere&#8221; (1490) is your typical 15th century portrait.</p>
<p>Not too interesting. Rembrandt is the place to look for interesting portraits.</p>
<p>&#8220;<em>Weiher im Walde&#8221; (1495) </em>is more interesting:</p>
<p>The brush strokes and colors remind me of van Gogh and at first glance one could easily read this picture into the present day debate about man-made pollution vs. Nature.</p>
<p>It looks almost like chimneys to the left sending agressive black smoke into the forrest to the right.</p>
<p>I love it when old works of art suddenly ressemble something that wasn&#8217;t around when they were made:</p>
<p>Or how about <em>&#8220;Feldhase&#8221; </em>(1502) &#8211; this could be an illustration in a modern encyclopedia. Very impressive and realistic! I could be fooled if someone told me it was 20th century:</p>
<p>&#8220;Melancholia I&#8221; (1514)  is much less naturalistic, but instead it has this almost Picasso-like avant garde quality about the composition &#8211; with its interwoven shapes and the twisted perspective. Quite impressive, I think:</p>
<p>And here&#8217;s my personal favourite: <em>&#8220;Rhinocerus&#8221;</em> (1515).</p>
<p>I think the rhinos&#8217; facual expression is priceless! (-:</p>
<p>&#8220;Wrap it up, dude! Nature calls &#8230;&#8221;</p>
<p>More about Albrecht Dürer:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Albrecht_Dürer">http://en.wikipedia.org/wiki/Albrecht_Dürer</a></li>
<li><a href="http://www.ibiblio.org/wm/paint/auth/durer/">http://www.ibiblio.org/wm/paint/auth/durer/</a></li>
<li><a href="http://www.artchive.com/artchive/D/durer.htm">http://www.artchive.com/artchive/D/durer.htm</a>l</li>
</ul>
]]></description>
			<content:encoded><![CDATA[<p><strong>Edit: At the time of writing, the Albrecth Dührer painting was used in the design of this site.<br />
This has been changed since. </strong></p>
<p>The background painting on this page is by the German painter Albrecht Dürer (1471 – 1528).</p>
<p>It’s from 1503 and the title of the painting is ”Das große Rasenstück” or ”The Large Turf”.</p>
<div class="wp-caption alignnone" style="width: 476px"><img title="Das große Rasenstück" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Duerer_the_large_turf.jpg/466px-Duerer_the_large_turf.jpg" alt="Das große Rasenstück" width="466" height="599" /><p class="wp-caption-text">Das große Rasenstück</p></div>
<p>I decided that I wanted a real painting for the background, so I browsed around the web, came across this one and loved it instantly. It has amazing details in both color and perspective. And the colors made a nice palette for the rest of my design.</p>
<p>Considering the paintings&#8217; year of origin, it’s incredibly modern looking!</p>
<p>It does have this special pre-renaissance or late medieval feel about it, though (those who read Foucault – ”The order of things” will probaby know what I mean). There’s something about the way the whole setting is illuminated that gives it a magical edge.</p>
<p>Here are some more pictures by Dürer:</p>
<p>&#8220;Porträt Albrecht Dürer der Ältere&#8221; (1490) is your typical 15th century portrait.</p>
<div class="wp-caption alignnone" style="width: 489px"><img title="Porträt Albrecht Dürer der Ältere" src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/80/Albrecht_Dürer_071.jpg/479px-Albrecht_Dürer_071.jpg" alt="Porträt Albrecht Dürer der Ältere" width="479" height="600" /><p class="wp-caption-text">Porträt Albrecht Dürer der Ältere</p></div>
<p>Not too interesting. Rembrandt is the place to look for interesting portraits.</p>
<p>&#8220;<em>Weiher im Walde&#8221; (1495) </em>is more interesting:</p>
<div class="wp-caption alignnone" style="width: 570px"><img class=" " title="Weiher im Walde" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Albrecht_Dürer_106.jpg/800px-Albrecht_Dürer_106.jpg" alt="Weiher im Walde" width="560" height="386" /><p class="wp-caption-text">Weiher im Walde</p></div>
<p>The brush strokes and colors remind me of van Gogh and at first glance one could easily read this picture into the present day debate about man-made pollution vs. Nature.</p>
<p>It looks almost like chimneys to the left sending agressive black smoke into the forrest to the right.</p>
<p>I love it when old works of art suddenly ressemble something that wasn&#8217;t around when they were made:</p>
<p>Or how about <em>&#8220;Feldhase&#8221; </em>(1502) &#8211; this could be an illustration in a modern encyclopedia. Very impressive and realistic! I could be fooled if someone told me it was 20th century:</p>
<div class="wp-caption alignnone" style="width: 550px"><img title="Feldhase" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Durer_Young_Hare.jpg/540px-Durer_Young_Hare.jpg" alt="Feldhase" width="540" height="599" /><p class="wp-caption-text">Feldhase</p></div>
<p>&#8220;Melancholia I&#8221; (1514)  is much less naturalistic, but instead it has this almost Picasso-like avant garde quality about the composition &#8211; with its interwoven shapes and the twisted perspective. Quite impressive, I think:</p>
<div class="wp-caption alignnone" style="width: 474px"><img title="Melancholia I" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/18/Dürer_Melancholia_I.jpg/464px-Dürer_Melancholia_I.jpg" alt="Melancholia I" width="464" height="599" /><p class="wp-caption-text">Melancholia I</p></div>
<p>And here&#8217;s my personal favourite: <em>&#8220;Rhinocerus&#8221;</em> (1515).</p>
<p>I think the rhinos&#8217; facual expression is priceless! (-:</p>
<div class="wp-caption alignnone" style="width: 588px"><img class="  " title="Rhinocerus" src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Dürer_rhino.png/722px-Dürer_rhino.png" alt="Rhinoserus" width="578" height="480" /><p class="wp-caption-text">Rhinocerus</p></div>
<p>&#8220;Wrap it up, dude! Nature calls &#8230;&#8221;</p>
<p>More about Albrecht Dürer:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Albrecht_Dürer">http://en.wikipedia.org/wiki/Albrecht_Dürer</a></li>
<li><a href="http://www.ibiblio.org/wm/paint/auth/durer/">http://www.ibiblio.org/wm/paint/auth/durer/</a></li>
<li><a href="http://www.artchive.com/artchive/D/durer.htm">http://www.artchive.com/artchive/D/durer.htm</a>l</li>
</ul>
 <p><a href="http://www.jakobloekkemadsen.com/?flattrss_redirect&amp;id=103&amp;md5=3137ecb585f16d6e88ea833e0851b014" title="Flattr" target="_blank"><img src="http://www.jakobloekkemadsen.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p><img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/VmyrUeu1rBQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2010/01/whats-with-the-painting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=jakobloekke&amp;popout=1&amp;url=http%3A%2F%2Fwww.jakobloekkemadsen.com%2F2010%2F01%2Fwhats-with-the-painting%2F&amp;language=en_GB&amp;category=text&amp;title=What%26%238217%3Bs+with+the+painting%3F&amp;description=Edit%3A+At+the+time+of+writing%2C+the+Albrecth+D%C3%BChrer+painting+was+used+in+the+design+of+this+site.+This+has+been+changed+since.+The+background+painting+on+this+page+is...&amp;tags=Albrecht+D%C3%BChrer%2CArt%2Cgerman+artist%2Cintertextuality%2Cpainting%2Cblog" type="text/html" />
	<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/01/whats-with-the-painting/</feedburner:origLink></item>
	</channel>
</rss>
