<?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. Design. Code.</description>
	<lastBuildDate>Thu, 02 Feb 2012 15:06:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</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>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&#8230; <a href="http://www.jakobloekkemadsen.com/2011/11/how-to-use-knockout-js-with-xslt/" class="read_more">Read the rest</a></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>
<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>0</slash:comments>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2011/11/how-to-use-knockout-js-with-xslt/</feedburner:origLink></item>
		<item>
		<title>Sharepoint error message of the day</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/mv8gOAhz1us/</link>
		<comments>http://www.jakobloekkemadsen.com/2011/10/sharepoint-error-message-of-the-day/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 12:48:09 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[fail]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=241</guid>
		<description><![CDATA[<p>Trusty ol&#8217; Microsoft Sharepoint &#8230;<br />
King of sensical error messages:</p>
<p><a href="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/10/error.jpg"><img class="alignnone size-full wp-image-242" title="error" src="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/10/error.jpg" alt="" width="616" height="295" /></a></p>
]]></description>
			<content:encoded><![CDATA[<p>Trusty ol&#8217; Microsoft Sharepoint &#8230;<br />
King of sensical error messages:</p>
<p><a href="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/10/error.jpg"><img class="alignnone size-full wp-image-242" title="error" src="http://www.jakobloekkemadsen.com/wp-content/uploads/2011/10/error.jpg" alt="" width="616" height="295" /></a></p>
<img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/mv8gOAhz1us" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2011/10/sharepoint-error-message-of-the-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2011/10/sharepoint-error-message-of-the-day/</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</strong>&#8230; <a href="http://www.jakobloekkemadsen.com/2011/09/dropcheck-a-magic-checklist-using-dropbox-and-knockout-js/" class="read_more">Read the rest</a></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>
<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>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2011/09/dropcheck-a-magic-checklist-using-dropbox-and-knockout-js/</feedburner:origLink></item>
		<item>
		<title>How to empty a Javascript array</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/VbSMuxw5YU0/</link>
		<comments>http://www.jakobloekkemadsen.com/2011/02/how-to-empty-a-javascript-array/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 15:11:59 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=197</guid>
		<description><![CDATA[<p>It&#8217;s easy:</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;">MyArray.length = 0;</pre></div></div>

<p>(Just a reminder to myself, since I&#8217;ve forgotten about this a few times &#8230;)</p>
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s easy:</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;">MyArray.length = 0;</pre></div></div>

<p>(Just a reminder to myself, since I&#8217;ve forgotten about this a few times &#8230;)</p>
<img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/VbSMuxw5YU0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2011/02/how-to-empty-a-javascript-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2011/02/how-to-empty-a-javascript-array/</feedburner:origLink></item>
		<item>
		<title>My Photoshop wishlist</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/RqWB05ttbT0/</link>
		<comments>http://www.jakobloekkemadsen.com/2010/10/my-photoshop-wishlist/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 19:19:41 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[graphic design]]></category>
		<category><![CDATA[photoshop]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=177</guid>
		<description><![CDATA[<h3>Color variables</h3>
<p>Imagine changing the color scheme of an entire design with flick of a switch. This would be a real time saver.</p>
<h3>States (like hover states or ajax states)</h3>
<p>We&#8217;ve got layer comps. Now make them interactive. Maybe something&#8230; <a href="http://www.jakobloekkemadsen.com/2010/10/my-photoshop-wishlist/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<h3>Color variables</h3>
<p>Imagine changing the color scheme of an entire design with flick of a switch. This would be a real time saver.</p>
<h3>States (like hover states or ajax states)</h3>
<p>We&#8217;ve got layer comps. Now make them interactive. Maybe something like <a href="http://www.axure.com/">Axure</a>.<br />
Right now, Fireworks is just too complicated to bridge the gap between prototyping and proper graphic design.</p>
<h3>Hide layers (like hide tracks in Logic)</h3>
<p>In <a href="http://www.apple.com/logicstudio/">Logic</a>, every track can be hidden if they&#8217;re not used. This drasticly reduces clutter in the arrange window.<br />
Why not make this possible with layers in Photoshop?</p>
<h3>Version Control</h3>
<p>In code this is indispensable.<br />
I feel like it is in graphic design as well. It&#8217;s just not available yet &#8230;</p>
<h3>Intelligent update of smart layers from separate files</h3>
<p>Imagine having a central repository of elements that could be shared between projects or multiple designs within a single project and maintained in a single place.<br />
This is a concept that&#8217;s essential in software engineering. Why not let graphic designers benefit from it as well?</p>
<img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/RqWB05ttbT0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2010/10/my-photoshop-wishlist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/10/my-photoshop-wishlist/</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&#8230; <a href="http://www.jakobloekkemadsen.com/2010/10/how-to-make-css3pie-work/" class="read_more">Read the rest</a></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>
<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>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/10/how-to-make-css3pie-work/</feedburner:origLink></item>
		<item>
		<title>Pick your browser …</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/UpqRg3GeofA/</link>
		<comments>http://www.jakobloekkemadsen.com/2010/03/pick-your-browser/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 18:59:51 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Politics]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=166</guid>
		<description><![CDATA[<p>Alright!</p>
<p>The good people at Microsoft have introduced the <a href="http://microsoftontheissues.com/cs/blogs/mscorp/archive/2010/02/19/the-browser-choice-screen-for-europe-what-to-expect-when-to-expect-it.aspx" target="_blank">Browser Choice</a> splash screen on new Windows installations.<br />
I thought I&#8217;d try it out by re-installing the Windows XP that runs in VMWare on my Macbook.</p>
<p>After running&#8230; <a href="http://www.jakobloekkemadsen.com/2010/03/pick-your-browser/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>Alright!</p>
<p>The good people at Microsoft have introduced the <a href="http://microsoftontheissues.com/cs/blogs/mscorp/archive/2010/02/19/the-browser-choice-screen-for-europe-what-to-expect-when-to-expect-it.aspx" target="_blank">Browser Choice</a> splash screen on new Windows installations.<br />
I thought I&#8217;d try it out by re-installing the Windows XP that runs in VMWare on my Macbook.</p>
<p>After running the install and the massive pile of updates following it, I rebootet and was greeted by the Browser Choice introduction.<br />
I then clicked OK to confirm that I was connected to the Internet and ready to make my choice &#8230;</p>
<p>This is what happened:</p>
<div id="attachment_167" class="wp-caption alignnone" style="width: 310px"><a href="http://www.jakobloekkemadsen.com/wp-content/uploads/2010/03/Billede-1.png"><img class="size-medium wp-image-167" title="Browser Choice" src="http://www.jakobloekkemadsen.com/wp-content/uploads/2010/03/Billede-1-300x187.png" alt="Time to pick a browser. Which one should I choose ... hmmmm ..." width="300" height="187" /></a><p class="wp-caption-text">Time to pick a browser. Which one should I choose ... hmmmm ...</p></div>
<p>What a funny coincidence!<br />
It appears that the freshly updated IE has opened it&#8217;s configuration wizard right on top of the Browser Choice window &#8230;</p>
<p>(-:</p>
<img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/UpqRg3GeofA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2010/03/pick-your-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/03/pick-your-browser/</feedburner:origLink></item>
		<item>
		<title>Winter shots from Norway</title>
		<link>http://feedproxy.google.com/~r/Jakobloekkemadsen/~3/79FaqG53AOc/</link>
		<comments>http://www.jakobloekkemadsen.com/2010/03/winter-shoots/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 11:21:39 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[Photos]]></category>
		<category><![CDATA[Nature]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[snow]]></category>

		<guid isPermaLink="false">http://www.jakobloekkemadsen.com/?p=160</guid>
		<description><![CDATA[<p>Some photos from last week&#8217;s trip to Norway:<br />
<img class="flickr" src="http://farm5.static.flickr.com/4017/4431890136_5702563bcd.jpg" alt="DSC_3722" /></p>
<p><img class="flickr" src="http://farm5.static.flickr.com/4016/4431886852_6d70f7429c.jpg" alt="DSC_3652" /></p>
<p><img class="flickr" src="http://farm3.static.flickr.com/2717/4431121763_757a01ce3b.jpg" alt="DSC_3743" /></p>
<p><img class="flickr" src="http://farm3.static.flickr.com/2762/4431883574_ae40507e0a.jpg" alt="DSC_3567" /></p>
<p><img class="flickr" src="http://farm3.static.flickr.com/2786/4431886132_f70840c16e.jpg" alt="DSC_3648" /></p>
<p><img class="flickr" src="http://farm5.static.flickr.com/4039/4431887552_ab8a021f05.jpg" alt="DSC_3653" /></p>
]]></description>
			<content:encoded><![CDATA[<p>Some photos from last week&#8217;s trip to Norway:<br />
<img class="flickr" src="http://farm5.static.flickr.com/4017/4431890136_5702563bcd.jpg" alt="DSC_3722" /></p>
<p><img class="flickr" src="http://farm5.static.flickr.com/4016/4431886852_6d70f7429c.jpg" alt="DSC_3652" /></p>
<p><img class="flickr" src="http://farm3.static.flickr.com/2717/4431121763_757a01ce3b.jpg" alt="DSC_3743" /></p>
<p><img class="flickr" src="http://farm3.static.flickr.com/2762/4431883574_ae40507e0a.jpg" alt="DSC_3567" /></p>
<p><img class="flickr" src="http://farm3.static.flickr.com/2786/4431886132_f70840c16e.jpg" alt="DSC_3648" /></p>
<p><img class="flickr" src="http://farm5.static.flickr.com/4039/4431887552_ab8a021f05.jpg" alt="DSC_3653" /></p>
<img src="http://feeds.feedburner.com/~r/Jakobloekkemadsen/~4/79FaqG53AOc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jakobloekkemadsen.com/2010/03/winter-shoots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/03/winter-shoots/</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><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 &#8211; basically &#8211; 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&#8230; <a href="http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-2-scaffold-css/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<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 &#8211; basically &#8211; 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>
<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>
		<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&#8230; <a href="http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-1-slir/" class="read_more">Read the rest</a></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>
<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>
		<feedburner:origLink>http://www.jakobloekkemadsen.com/2010/02/useful-php-libraries-part-1-slir/</feedburner:origLink></item>
	</channel>
</rss>

