<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>pko.ch &#187; Rant</title>
	<atom:link href="http://pko.ch/category/rant/feed/" rel="self" type="application/rss+xml" />
	<link>http://pko.ch</link>
	<description>Reflections about reflection</description>
	<lastBuildDate>Sat, 28 Mar 2009 16:23:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>jQuery &lt;select/&gt; filter</title>
		<link>http://pko.ch/2009/03/28/jquery-select-filter/</link>
		<comments>http://pko.ch/2009/03/28/jquery-select-filter/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 16:16:20 +0000</pubDate>
		<dc:creator>pkoch</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://pko.ch/?p=42</guid>
		<description><![CDATA[First I was like: &#60;script&#62; $(document).ready(function(){ jQuery.extend(jQuery.expr[':'], { containsIgnoreCase: "(a.textContent&#124;&#124;a.innerText&#124;&#124;jQuery(a).text()&#124;&#124;'').toLowerCase().indexOf((m[3]&#124;&#124;'').toLowerCase())>=0" }); $('input.filterer').keyup(function(){ $('#'+$(this).attr('target_id')+' option').show().not(':containsIgnoreCase('+$(this).val()+')').hide() }); }); &#60;/script&#62; &#60;input class="filterer" target_id="target_select_id" type="text"/&#62; But then IE made me do: &#60;script&#62; $(document).ready(function(){ jQuery.extend(jQuery.expr[':'], { containsIgnoreCase: "(a.textContent&#124;&#124;a.innerText&#124;&#124;jQuery(a).text()&#124;&#124;'').toLowerCase().indexOf((m[3]&#124;&#124;'').toLowerCase())>=0" }); $('input.filterer').each(function(){ $('&#60;select id="'+$(this).attr('target_id')+'_stash" style="display:none;" /&#62;') .insertBefore($('#'+$(this).attr('target_id'))); }); $('input.filterer').keyup(function(){ var visible_select = '#'+$(this).attr('target_id'); var hidden_select = visible_select+'_stash'; var needle = $(this).val(); $(visible_select+' [...]]]></description>
			<content:encoded><![CDATA[<p>First I was like:<br />
<code></p>
<pre>
&lt;script&gt;
$(document).ready(function(){
    jQuery.extend(jQuery.expr[':'], {
      containsIgnoreCase:
        "(a.textContent||a.innerText||jQuery(a).text()||'').toLowerCase().indexOf((m[3]||'').toLowerCase())>=0"
    });
    $('input.filterer').keyup(function(){
        $('#'+$(this).attr('target_id')+' option').show().not(':containsIgnoreCase('+$(this).val()+')').hide()
    });
});
&lt;/script&gt;
&lt;input class="filterer" target_id="target_select_id" type="text"/&gt;
</pre>
<p></code><br />
But then IE made me do:<br />
<code></p>
<pre>
&lt;script&gt;
$(document).ready(function(){
    jQuery.extend(jQuery.expr[':'], {
      containsIgnoreCase:
        "(a.textContent||a.innerText||jQuery(a).text()||'').toLowerCase().indexOf((m[3]||'').toLowerCase())>=0"
    });
    $('input.filterer').each(function(){
        $('&lt;select id="'+$(this).attr('target_id')+'_stash" style="display:none;" /&gt;')
            .insertBefore($('#'+$(this).attr('target_id')));
    });
    $('input.filterer').keyup(function(){
	var visible_select = '#'+$(this).attr('target_id');
	var hidden_select = visible_select+'_stash';
	var needle = $(this).val();
	$(visible_select+' option').not(':containsIgnoreCase('+needle+')').remove()
            .appendTo($(hidden_select)).removeAttr('selected');
	$(hidden_select+' option:containsIgnoreCase('+needle+')').remove()
            .appendTo($(visible_select)).removeAttr('selected');
    });
});
&lt;/script&gt;
&lt;input class="filterer" target_id="target_select_id" type="text"/&gt;
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://pko.ch/2009/03/28/jquery-select-filter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chand-FAIL-ler</title>
		<link>http://pko.ch/2008/08/12/chand-fail-ler/</link>
		<comments>http://pko.ch/2008/08/12/chand-fail-ler/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 23:16:44 +0000</pubDate>
		<dc:creator>pkoch</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://pko.ch/?p=14</guid>
		<description><![CDATA[Chandler always looked promising. I was really happy when I heard 1.0 just came out. Because I hadn&#8217;t my laptop around, I tried the web version and felt ok with it. But that was my last step in my trail of Chandler faith. As soon as Chandler Desktop booted up, I was greeted with a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chandlerproject.org/wikihome">Chandler</a> always looked promising. I was really happy when I heard 1.0 just came out. Because I hadn&#8217;t my laptop around, I tried the web version and felt ok with it.</p>
<p>But that was my last step in my trail of Chandler faith. As soon as <em>Chandler Desktop</em> booted up, I was greeted with a soft, warm and fuzzy python exception: &#8220;Hey! This function receives one argument, you gave it two!&#8221;. Never good.</p>
<p>Tried to report the bug. Need a login for some bugzilla somewhere. Hmm, guess I&#8217;ll pass.</p>
]]></content:encoded>
			<wfw:commentRss>http://pko.ch/2008/08/12/chand-fail-ler/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>When rewriting is the &#8220;not bad&#8221; result</title>
		<link>http://pko.ch/2008/06/20/when-rewriting-is-the-not-bad-result/</link>
		<comments>http://pko.ch/2008/06/20/when-rewriting-is-the-not-bad-result/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 01:14:38 +0000</pubDate>
		<dc:creator>pkoch</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://pko.ch/?p=13</guid>
		<description><![CDATA[I was reading Don&#8217;t be clever and came across this excerpt: And don&#8217;t think that I am saying that there is no place for optimization, that is not true, there is just less room for optimization in the source itself, but there is lots of room for optimizations in terms of overall system performance and [...]]]></description>
			<content:encoded><![CDATA[<p>I was reading <a href="http://www.codethinked.com/post/2007/12/Dont-be-clever.aspx">Don&#8217;t be clever</a> and came across this excerpt:</p>
<blockquote><p>
And don&#8217;t think that I am saying that there is no place for optimization, that is not true, there is just less room for optimization in the source itself, but there is lots of room for optimizations in terms of overall system performance and in terms of developer productivity. It is more important to focus on the big picture and solve performance problems that are system wide, or refactor code so that changes can be made much faster, than it is to solve a performance problem in a single line of code&#8230;unless of course that line of code is being called 8 million times by 50 parts of the system.</p>
<p>So next time you go to write a super clever line of code, think to yourself &#8220;Will the benefits of this super cleverness be outweighed by the future issues in maintaining and understanding the code?&#8221; And if there is any hesitation at all, then you better not be clever, because 3 months from now you will come across that code and say &#8220;What the hell was I thinking?&#8221; Then you&#8217;ll end up rewriting it anyway.
</p></blockquote>
<p>It&#8217;s quite correct, except for one little detail: &#8220;Then you&#8217;ll end up rewriting it anyway&#8221;.</p>
<p>I wish! Doing it right the first time is the good solution, but rewriting it when you latter come across it and realise it&#8217;s stupid is a &#8220;not good, not bad&#8221; solution. The problem is when you just <strong>can&#8217;t</strong> rewrite that piece of crap! Maybe you can&#8217;t test it, maybe you have something more important to do, maybe you don&#8217;t really understand it, maybe maybe maybe&#8230;</p>
<p>I could segway this into the perfect TDD and &#8220;Tests as a living, runnable spec&#8221; pitch, but I&#8217;ll let it rest.</p>
]]></content:encoded>
			<wfw:commentRss>http://pko.ch/2008/06/20/when-rewriting-is-the-not-bad-result/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
