<?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>underdevelopment</title>
	
	<link>http://www.underdevelopment.eu</link>
	<description>web development blog</description>
	<lastBuildDate>Wed, 30 Jun 2010 23:02:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/underdevelopment/AdPR" /><feedburner:info uri="underdevelopment/adpr" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>traveling elephpant</title>
		<link>http://feedproxy.google.com/~r/underdevelopment/AdPR/~3/zXxWg_HGjHw/</link>
		<comments>http://www.underdevelopment.eu/2010/06/30/travelingelephpant/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 21:58:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[spielerij]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[traveling salesman]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=239</guid>
		<description><![CDATA[So a little while back ibuildings had this fun contest to build a path finding program that would solve a traveling salesman like problem. The constraints where pretty simple, you got a CSV file with latitude/longitude locations. You started at a certain location and you should end at a certain location. The application should then [...]]]></description>
			<content:encoded><![CDATA[<p>So a little while back <a href="http://www.ibuildings.com/">ibuildings</a> had this <a href="http://techportal.ibuildings.com/2010/05/17/the-elephpant-challenge-winners-and-results/">fun contest</a> to build a path finding program that would solve a traveling salesman like problem. The constraints where pretty simple, you got a CSV file with latitude/longitude locations. You started at a certain location and you should end at a certain location. The application should then find the shortest route that touched all locations.</p>
<p>Now I&#8217;ll be the first to say that PHP is really not the language for that. A few years back I wrote a pathfinding tool for use with a game called EVE online in which I calculated certain trade routes based on data you could export from the game. After seeing PHP&#8217;s performance I switched to Python and more or less sliced the processing time in half if not more. Mainly because Python has specific array like types and PHP just has generic array&#8217;s, which with large data sets matters a lot.  Perhaps also because my pathfinding-foo was still rather weak <img src='http://www.underdevelopment.eu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>However, back to now and the ibuildings challenge. The challenge would be rated on 3 criteria. Speed, lines of code and code complexity. Personally I could care less about the latter two and focused purely on speed. In the weeks that followed I had a great time comparing execution times with <a href="http://twitter.com/remi_woler">Remi</a> and <a href="http://twitter.com/andriesss">Andries</a>. I think this was also key to keep diving into it and tweaking it until it was as fast as I could get it.</p>
<p>Sadly, my submission actually had a off-by-one bug in it which more or less instantly disqualified my entry. Yes, bit of a bummer, but such is life.</p>
<p>Now I had already decided to publish my code after the contest, however sadly I never really found the time to type this up. So a bit late but here is the code for my solution for the ibuildings elephpant challenge.</p>
<p>Below is the submitted code, and a link to download the code and original test data file so you can try it out for yourself.</p>
<p><a href="http://ubuntuone.com/p/8Qq/">download the code</a> &#8211; Just unpack and run via <em>php contest.php elephpant_landmarks.csv</em></p>
<p><em>-edit-</em></p>
<p><em>Ok scratch the code, I&#8217;m having some trouble with getting it to play nice. Just download the tar.gz and view the code in your favorite editor.<br />
</em></p>
<p><em><br />
</em></p>
<img src="http://feeds.feedburner.com/~r/underdevelopment/AdPR/~4/zXxWg_HGjHw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2010/06/30/travelingelephpant/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.underdevelopment.eu/2010/06/30/travelingelephpant/</feedburner:origLink></item>
		<item>
		<title>running ubuntu on a vaio BZ series laptop</title>
		<link>http://feedproxy.google.com/~r/underdevelopment/AdPR/~3/ehlGf45wrWA/</link>
		<comments>http://www.underdevelopment.eu/2010/01/18/running-ubuntu-on-a-vaio-bz-series-laptop/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 09:40:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[sony vaio]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=233</guid>
		<description><![CDATA[I recently purchased a sony vaio VGN-BZ31VT. To be short, everything works for as far as I know and care. Specs CPU: Intel® Core™2 Duo-processor P8700 @ 2,53 Ghz mem: DDR2 SDRAM (2 x 2 GB) graphics: Mobile Intel® Graphics Media Accelerator 4500MHD Wifi: intel wifi link 5100 audio: intel HD audio ethernet: Intel 82567 [...]]]></description>
			<content:encoded><![CDATA[<p>I recently purchased a sony vaio VGN-BZ31VT. To be short, everything works for as far as I know and care.</p>
<p><strong>Specs</strong></p>
<p>CPU: Intel® Core™2 Duo-processor P8700 @ 2,53 Ghz<br />
mem: DDR2 SDRAM (2 x 2 GB)<br />
graphics: Mobile Intel® Graphics Media Accelerator 4500MHD</p>
<p>Wifi: intel wifi link 5100<br />
audio: intel HD audio<br />
ethernet: Intel 82567 Gigabit<br />
bluetooth: ?  2.0 + EDR</p>
<p><strong>what works</strong></p>
<p>Well all the basics seem to work, the special function keys on the keyboard, the mouse pad, the screen, wifi and ethernet port.<br />
But most importantly, suspend and hibernate also work. All of this out of the box, just install and go.</p>
<p>incidentally, this CPU also support intel VT, it is off by default, but you can easily enable it in the bios. If like me you use virtual machines a lot, it is rather nice to have. Haven&#8217;t done any real tests to see if it is faster, but at least it&#8217;s there.</p>
<p><strong>Not tested</strong></p>
<p>I haven&#8217;t tested bluetooth, don&#8217;t need it.</p>
<p><strong>What doesn&#8217;t work</strong></p>
<p>The laptop also has a fingerprint scanner, which with some tinkering can be used. It&#8217;s not so much a problem of hardware support it seems, but more that there isn&#8217;t a mainstream way of integrating fingerprints scanners with the security system in linux. The solution I read needs you to install some fingerprint scanning software and load that as a module in PAM. Too much work for too little gain for my taste, but if you really want it, then you can get it to work (probably).</p>
<p><strong>conclusion</strong></p>
<p>I wanted a no-nonsense development laptop with lots of memory and preferably virtualization support in the CPU, it should also work under linux with minimal fuss and suspend working was a must have.<br />
Mission successful it seems.</p>
<p>Seeing as there is very little recent user experience info about this laptop out there at the moment, i figured i should write this little blog, if only to give people the peace of mind that you can safely buy this laptop for running linux.</p>
<img src="http://feeds.feedburner.com/~r/underdevelopment/AdPR/~4/ehlGf45wrWA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2010/01/18/running-ubuntu-on-a-vaio-bz-series-laptop/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.underdevelopment.eu/2010/01/18/running-ubuntu-on-a-vaio-bz-series-laptop/</feedburner:origLink></item>
		<item>
		<title>user settings cookie</title>
		<link>http://feedproxy.google.com/~r/underdevelopment/AdPR/~3/BlJtPravBnE/</link>
		<comments>http://www.underdevelopment.eu/2010/01/17/user-settings-cookie/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 00:29:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[object oriented programming]]></category>
		<category><![CDATA[singleton]]></category>
		<category><![CDATA[techniques]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=217</guid>
		<description><![CDATA[Sometimes in applications you will have certain user settings that you want to apply, even when the user is not logged in. Take for instance these examples: &#8220;welcome back &#60;name&#62;&#8221; msg on return. You have a portal type page where the user can control what content is shown where You want to track where the [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes in applications you will have certain user settings that you want to apply, even when the user is not logged in. Take for instance these examples:</p>
<ul>
<li> &#8220;welcome back &lt;name&gt;&#8221; msg on return.</li>
<li>You have a portal type page where the user can control what content is shown where</li>
<li>You want to track where the user was when he last visited the site, perhaps to offer him the option to return to there.</li>
</ul>
<p>I recently needed some functionality like that. So I&#8217;ve created a object that can help me with that.</p>
<p>I thought about it for a moment and created a singleton settings object for me to call upon to set and retrieve certain settings. Now I have to warn you that there is a small problem with singletons, if you use unit testing it can be difficult to control the behaviour of singletons over multiple tests. So be wary of this when you are running unit tests.</p>
<p>I also wrap all data in a separate array. This isn&#8217;t really necessary, but it makes handling the data a lot easier. If you wanted you could also add some sort of encryption to the cookie data so that users couldn&#8217;t easily tamper with it.</p>
<textarea cols="40" rows="10" name="code" class="Php"><?php

class settings
{
        private static $instance;

        protected $data;

        private function __construct()
        {
            $this->data = array();
            $this->loadSettings();
        }

        public static function getInstance()
        {
            if (!self::$instance)
            {
                self::$instance = new settings();
            }

            return self::$instance;
        }

        protected function saveSettings()
        {
            $data = serialize($this->data);
            setcookie("TestCookie", $data, time()+3600);
        }

        protected function loadSettings()
        {
            $data = $_COOKIE['TestCookie'];
            if ($data != false)
            {
                $this->data = unserialize($data);
            }
        }

        public function __set($property,$value)
        {
            $this->data[$property] = $value;
            $this->saveSettings();
        }

        public function __get($property)
        {
            return (isset($this->data[$property])) ? $this->data[$property] : false;
        }

        public function setName($name)
        {
            self::getInstance()->name = $name;
        }

        public function getName()
        {
            return self::getInstance()->name;
        }
}


if (isset($_GET['name'])) settings::setName($_GET['name']);
echo "Welcome back ".settings::getName();</textarea>
	<!-- Wordpress Code Snippet -->
	<script type="text/javascript" src="http://www.underdevelopment.eu/wp-content/plugins/wordpress-code-snippet/js/shCore.js"></script><script type="text/javascript" src="http://www.underdevelopment.eu/wp-content/plugins/wordpress-code-snippet/js/shBrushPhp.js"></script>
	<link type="text/css" rel="stylesheet" href="http://www.underdevelopment.eu/wp-content/plugins/wordpress-code-snippet/css/SyntaxHighlighter.css"/>
	
	<script language="javascript">
	dp.SyntaxHighlighter.ClipboardSwf = 'http://www.underdevelopment.eu/wp-content/plugins/wordpress-code-snippet/js/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	</script>
	<!-- End Wordpress Code Snippet -->
	<img src="http://feeds.feedburner.com/~r/underdevelopment/AdPR/~4/BlJtPravBnE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2010/01/17/user-settings-cookie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.underdevelopment.eu/2010/01/17/user-settings-cookie/</feedburner:origLink></item>
		<item>
		<title>easy and simple transparency effect using GIF</title>
		<link>http://feedproxy.google.com/~r/underdevelopment/AdPR/~3/Qt8WbCC53_U/</link>
		<comments>http://www.underdevelopment.eu/2009/10/03/easy_and_simple_transparency_effect_using_gif/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 20:28:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=190</guid>
		<description><![CDATA[Transparency in HTML/CSS is largely an already solved problem, recent browsers all seem to handle PNG transparency pretty well and there are scripts that will make sure older browsers will handle them as well. However, I wanted to make a post about a little technique I rarely see used which I think is quite genius [...]]]></description>
			<content:encoded><![CDATA[<p>Transparency in HTML/CSS is largely an already solved problem, recent browsers all seem to handle PNG transparency pretty well and there are scripts that will make sure older browsers will handle them as well.</p>
<p><img class="alignright size-full wp-image-193" title="transparant gif example" src="http://www.underdevelopment.eu/wp-content/uploads/2009/10/transparant-gif-example1.gif" alt="transparant gif example" width="90" height="90" />However, I wanted to make a post about a little technique I rarely see used which I think is quite genius in it&#8217;s simplicity.  Whenever you want to create a semi-transparent surface you create a gif file that contains a simple pattern of transparent and opaque pixels; as in the example on the right.  The white you see in the chequered image is of course transparent.</p>
<p>So let&#8217;s demonstrate how this effect actually looks.</p>
<p><img class="aligncenter size-full wp-image-208" title="transparency examples" src="http://www.underdevelopment.eu/wp-content/uploads/2009/10/transparency-examples2.png" alt="transparency examples" width="420" height="140" /></p>
<p style="text-align: center;">
<p>Now as you can see the effect itself is very specific, and different backgrounds have different outcomes for the effect. Which might not fit every design. Another disadvantage is that it can only be used to show a 50% transparency effect. There might be pixel patterns that will give you a different distribution but I&#8217;ve never seen them.</p>
<p>The biggest advantage however is that you don&#8217;t need any fancy CSS or javascript or PNG, which in certain specific cases can be a big plus.  It&#8217;s more of a hack on your eyes/brain then on the browser <img src='http://www.underdevelopment.eu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/underdevelopment/AdPR/~4/Qt8WbCC53_U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2009/10/03/easy_and_simple_transparency_effect_using_gif/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.underdevelopment.eu/2009/10/03/easy_and_simple_transparency_effect_using_gif/</feedburner:origLink></item>
		<item>
		<title>Simple design rules for webdevelopers</title>
		<link>http://feedproxy.google.com/~r/underdevelopment/AdPR/~3/Z8dc-wy4Nms/</link>
		<comments>http://www.underdevelopment.eu/2009/09/04/simple-design-rules-for-webdevelopers/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 10:02:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[usability]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=157</guid>
		<description><![CDATA[Designers. Can&#8217;t live with them, can&#8217;t live without them. More often then not, developers will have to work together with designers to create a website. Which most of the time means the designer will create a design and some HTML &#38; CSS. Which the developer will then integrate and adapt to fit into his software [...]]]></description>
			<content:encoded><![CDATA[<p>Designers. Can&#8217;t live with them, can&#8217;t live without them. More often then not, developers will have to work together with designers to create a website. Which most of the time means the designer will create a design and some HTML &amp; CSS. Which the developer will then integrate and adapt to fit into his software to actually make the site work.</p>
<p>The problem however is; Developers normally didn&#8217;t go to design school and many of them have the artistic ability of your average garden rock. I&#8217;m certainly no exception to that. However, if you learn a few basic guidelines and rules, you can make the life of your designer buddy a lot happier by not screwing up his design.</p>
<p>So here are just a few general hints and tips to explain what is important when adding something to a existing design or when integrating it into the actual software of the site.</p>
<p><strong>Aligning stuff</strong></p>
<p>Stuff needs to be aligned, both horizontally and vertically. It must be aligned &#8220;visually&#8221; instead of accurately, which means that if you look at it, it should look aligned. Which could mean two pixels to the right or left of the point where two blocks where actually aligned.</p>
<p>however as rule of thumb you can pretty much aligned them accurately. The reason for aligning stuff is because it is visually pleasing for us to look at.</p>
<p><img class="size-full wp-image-159 alignleft" title="misaligned" src="http://www.underdevelopment.eu/wp-content/uploads/2009/09/misaligned_example.png" alt="misaligned" width="296" height="243" /></p>
<p style="text-align: center;"><img class="size-full wp-image-159 aligncenter" title="aligned" src="http://www.underdevelopment.eu/wp-content/uploads/2009/09/aligned_example.png" alt="aligned" width="296" height="243" /></p>
<p>In some few cases the designer might actually want to purposefully have a few elements be misaligned, so if your doubting, just look at his designs or simply ask him.</p>
<p><strong>Whitespace</strong></p>
<p>Where saying less is more. Whitespace, as the name suggests, is the empty space around objects. As with alignment, everything should have a little bit of white space and for the most part, the amount of whitespace should be the same.</p>
<p>Whitespace brings some calm into a design. A design will look far less crowded with ample use. Also, whitespace will often be used to emphasise certain elements within a design. This is where the amount of whitespace will differ. Headers for instance will often have more whitespace around them then paragraphs.</p>
<p>It is also always a good idea to make sure there is a lot of whitespace around important elements for your website. When there is a lot of whitespace around a element in comparison to other elements on a page, your average human will read that element first.</p>
<p>If you want to know a lot more about whitespace, read <a href="http://www.alistapart.com/articles/whitespace/">this article from a list apart that deals exclusively with whitespace.</a></p>
<p><strong>colours</strong></p>
<p>Colours are not only pretty, but also important. Often companies and brands will have very specific colours associated with them. Coca Cola red, UPS gold&amp;brown, etc&#8230; Now designers could probably bore you for hours about colour theory and all that stuff. However what&#8217;s important for us developers to know, is to never introduce new colours. A designer will have chosen a small select group of colours for use in the design.</p>
<p>You will have one or two base colours, and a accent colour. For instance, for the design of this site, the base colours are light grey and white. and the accent colour is blue, and perhaps black.</p>
<p>What this means is that if I should add some new element, it should be one of those colours. Not purple simply because I like purple. Your best bet, depending on the size of the new element, would be to use the accent colour. The use of the accent colour is to basically add some spice to a design and use it to draw the attention of viewers.</p>
<p>When using colours, be precise. You might think, blue is blue is blue. But if your designer used #7c95e7 in his design, then be sure to use #7c95e7 as well. You could even ask your designer to write down the used colours for you in HEX.</p>
<p><strong>ask your designer</strong></p>
<p>Above are just a few general tips to watch for, but the best advice I can give is to simply ask your designer when in doubt or even just to verify. Because basically, It is like you created the software for the site and then some amateur takes it and start modifying it in small ways. I think most developers would at least like steer how those modifications are made, explain a bit what the thoughts where behind how it was written and such.</p>
<p>I have to say though, not all designers will like explaining it to you. But just remember, your not doing the above to please the designer, your doing the above to please the client, to make a better website. If that means having to bother your designer for 5 minutes, then so be it.</p>
<img src="http://feeds.feedburner.com/~r/underdevelopment/AdPR/~4/Z8dc-wy4Nms" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2009/09/04/simple-design-rules-for-webdevelopers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.underdevelopment.eu/2009/09/04/simple-design-rules-for-webdevelopers/</feedburner:origLink></item>
		<item>
		<title>Why I think test driven development suck</title>
		<link>http://feedproxy.google.com/~r/underdevelopment/AdPR/~3/FVZjJzMwvK0/</link>
		<comments>http://www.underdevelopment.eu/2009/08/29/why-i-think-test-driven-development-suck/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 01:56:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[object oriented programming]]></category>
		<category><![CDATA[pragmatic programmer]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[test driven development]]></category>
		<category><![CDATA[unit test]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=150</guid>
		<description><![CDATA[Well I figured a provocative title like that would catch your attention, so please read on to find out I am not as stupid as you might think. Unit tests are great, they reduce unknown bugs and arguably lead to better object design. The reasons for this are simple; Well thought out unit tests will [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.printfection.com/codesmack/All-Code-Is-Guilty/_s_58243"><img class="alignright size-full wp-image-153" title="TDD - All code is guilty until proven innocent" src="http://www.underdevelopment.eu/wp-content/uploads/2009/08/sTEyF.jpg" alt="TDD - All code is guilty until proven innocent" width="240" height="293" /></a>Well I figured a provocative title like that would catch your attention, so please read on to find out I am not as stupid as you might think.</p>
<p>Unit tests are great, they reduce unknown bugs and arguably lead to better object design. The reasons for this are simple; Well thought out unit tests will force you to think about the input and output of any method your objects may have, forcing you to correctly decomposition the needed functionality within your object, because methods that have too much responsibility are a pain in the ass to write unit tests for. Simple one task methods however are easy to write unit tests for. Because your writing unit tests you are (hopefully) actively thinking about what can go wrong so that methods can actually fail.</p>
<p>So taking for granted that the above is true, why does test driven development suck?<br />
Well the answer to that is a market one and really only applies to professional business. When a client comes to your business and asks for a offer for his project, you will quote him X, where X is roughly the amount of hours it takes to create the unit tests and then fill in the code + other stuff.</p>
<p>A development house that doesn&#8217;t use test driven development will quote that same client only for the time it takes to write the code + other stuff. We all know that after that he will spend a few weeks/months bugfixing, but that&#8217;s not what he quotes or tells the client.</p>
<p>Naturally the client will more often then not choose your competitor, unless you can positively convince him that the extra hours you spend will actually save him money in the long run. Which from the clients standpoint is a bit of an unproven claim if he is not technically inclined. So from a business standpoint, test driven development sucks as a selling tool.</p>
<p>Secondly, while this heavily depends on the morality of your business, those bugfix hours can be profitable. Depending on how smooth your talk is, you could very well be billing the client for those hours.</p>
<p>Thirdly, test driven development often suffers when deadlines need to be met. We all know that estimated hours is an imperfect science and often goes wrong, be it overconfident developers or overselling sales people, deadlines tend to be missed in our industry. So when deadlines are creeping, unit tests are often one of the first things to be dropped off schedule. Yes, we all know that shouldn&#8217;t happen, but it does. Once this has happened and no extra time is allocated to bring the tests up-to-date again (good luck getting that approved), the test driven development has failed and you&#8217;re just plainly developing again.</p>
<p>So for these reasons I think test driven development sucks. I might sometimes use it for private projects or open-source projects (for which I think it is absolutely brilliant), but certainly not for business ones. With the possible exception of in-house developed products, but I haven&#8217;t had much experience with that.</p>
<p>For anyone who now still thinks TDD is a sound development methodology, I would be very interested to hear you thoughts.</p>
<img src="http://feeds.feedburner.com/~r/underdevelopment/AdPR/~4/FVZjJzMwvK0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2009/08/29/why-i-think-test-driven-development-suck/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://www.underdevelopment.eu/2009/08/29/why-i-think-test-driven-development-suck/</feedburner:origLink></item>
		<item>
		<title>website text writing 101</title>
		<link>http://feedproxy.google.com/~r/underdevelopment/AdPR/~3/Ar5O42eDcrk/</link>
		<comments>http://www.underdevelopment.eu/2009/08/26/website-text-writing-101/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 01:47:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[usability]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[friendly text]]></category>
		<category><![CDATA[leading the user]]></category>
		<category><![CDATA[positive association]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=119</guid>
		<description><![CDATA[Now when people talk about websites and usability, a lot of stuff gets mentioned. Web 2.0, ajax, usability guidelines, designs etc.. etc.. What I however almost never hear is about the text. Sure people talk about content, user generated content, tagging, searching, etc.. But what about the little things? What about the buttons, the links, [...]]]></description>
			<content:encoded><![CDATA[<p>Now when people talk about websites and usability, a lot of stuff gets mentioned. Web 2.0, ajax, usability guidelines, designs etc.. etc.. What I however almost never hear is about the text. Sure people talk about content, user generated content, tagging, searching, etc..</p>
<p>But what about the little things? What about the buttons, the links, the subject lines of the e-mail someone receives? Those are the most read elements on your website, yet get the least amount of love.</p>
<p>So today I&#8217;m going to share some of my ideas on these texts, because I think they are important and should be treated as such. It all hit me about a year ago, at the <a href="http://phpconference.nl/">DPC08</a>, in the closing keynote by <a href="http://terrychay.com/blog/">Terry Chay</a>. He mentioned that when they added a smiley face to the subject line of some sort of mail they sent they saw a 20% increase in clickrate. That is nothing to scoff about. This got me thinking about how important these small texts are.</p>
<p>Over the year I&#8217;ve found a few key ideas about these texts that I think are important to keep in mind when creating them.</p>
<p><strong>Positive Association</strong><br />
When a user comes on a site he or she will have a lot of actions to take. Design and content placement determines a large part of what a user will do. But what about texts? Now lets say our goal is to get as many users to register. We could have a &#8220;register&#8221; link. The link is placed prominent and the design helps the user focus on it so that we are almost certain that the user will read it. So what can we now do to actually let the user click the link?</p>
<p>Your average register link, contains basically the word &#8220;register&#8221;. Hmmm. Now I don&#8217;t know about you, but registering is annoying. I have to fill in all kinds of info about myself and give them my e-mail address, which I don&#8217;t actually want to do.</p>
<p><img class="size-full wp-image-141 alignnone" title="join linkedin" src="http://www.underdevelopment.eu/wp-content/uploads/2009/08/join-linkedin.png" alt="join linkedin" width="121" height="18" /></p>
<p>It all sounds a bit too much like a command. What we want to do is create a short text that reminds us of the fun things about having an account. &#8220;Join the community&#8221;, &#8220;share your pictures&#8221;, &#8220;create your account&#8221; All much better then &#8220;register&#8221;, the text should be inviting and friendly.</p>
<p><strong>Leading the User</strong><img class="size-full wp-image-127 alignright" title="would you link to comment?" src="http://www.underdevelopment.eu/wp-content/uploads/2009/08/flickr-would-you-link-to-comment.png" alt="would you link to comment?" width="238" height="26" /><br />
When users visit sites we want to be able to guide them trough the site. We can effectively do this by emphasising what we want them to do via text. A good example of this is to be found on flickr. If you are not logged in, and you are viewing a photo, the site asks you &#8220;Would you like to comment?&#8221; instead of the often seen &#8220;To comment you have to be logged in&#8221;. If you think about it, the difference is miles apart. The flickr one makes me think, &#8216;do I want to comment?&#8217; the other one doesn&#8217;t. I just think &#8216;oh ok&#8217;.</p>
<p><img class="alignleft size-full wp-image-135" style="border: 1px solid black; margin-left: 5px; margin-right: 5px;" title="you must be logged in to leave a comment" src="http://www.underdevelopment.eu/wp-content/uploads/2009/08/write-a-comment.png" alt="you must be logged in to leave a comment" width="238" height="26" />The bit under both those texts is of course the same &#8220;sign up or login&#8221;. The difference however, is that after I&#8217;ve read the &#8220;Would you like to comment?&#8221; I actually either have decided I want to comment, or not. While with the other, I have no incentive at all to sign up or login. Or at least not if I wasn&#8217;t already planning to comment. Basically the flickr one reminds me that I can comment, and I even might want to comment.</p>
<p><strong>Don&#8217;t Lie</strong><br />
It is however important not to lie. Every time a users gets confronted with something they did not expect, a percentage of them will quit. So for instance, in the positive association part I wrote &#8220;share your pictures&#8221; as text example for a button to sign up. But that&#8217;s of course not what the user expects. We promised the user they could share their pictures when they clicked that link.</p>
<p>So to take that as an example, we should make sure that after the user clicks that link we present the user with more text that reinforces that they will be able to share their pictures, just after filling in a few details.<br />
That way we have given the user a clear incentive to register. This however often gets abused, I should make very clear that the page the user gets to see should not be a registration page, but a picture sharing page where you register. The actual sharing of pictures could of course be a step two of a wizard type structure.</p>
<img src="http://feeds.feedburner.com/~r/underdevelopment/AdPR/~4/Ar5O42eDcrk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2009/08/26/website-text-writing-101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.underdevelopment.eu/2009/08/26/website-text-writing-101/</feedburner:origLink></item>
		<item>
		<title>Setting up simple but easy to work with LAMP development environment</title>
		<link>http://feedproxy.google.com/~r/underdevelopment/AdPR/~3/hlLL2LeTegg/</link>
		<comments>http://www.underdevelopment.eu/2009/08/13/setting-up-simple-but-easy-to-work-with-lamp-development-environment/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 21:35:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[pragmatic programmer]]></category>
		<category><![CDATA[sshfs]]></category>
		<category><![CDATA[subclipse]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=103</guid>
		<description><![CDATA[I&#8217;ve recently changed the way I work so I figured I would detail it here. First off all let me describe the setup. Basically all my code resides in a subversion repository on server X. My development environment is a virtual server run on virtualbox, a default ubuntu server with a LAMP stack. On my [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently changed the way I work so I figured I would detail it here.</p>
<p>First off all let me describe the setup. Basically all my code resides in a subversion repository on server X.  My development environment is a virtual server run on virtualbox, a default ubuntu server with a LAMP stack. On my client I run the PDT edition of eclipse with subclips installed.</p>
<p><strong>The client side:</strong></p>
<ul>
<li>Install PDT eclipse, you can download it from <a href="http://www.eclipse.org/pdt/downloads/" >http://www.eclipse.org/pdt/downloads/</a>.</li>
<li>Go to <a href="http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA" />http://subclipse.tigris.org/</a> and follow the text to install it into your eclipse installation.</li>
<li>In your eclipse choose import from the file menu and select &#8220;checkout project from SVN&#8221;</li>
<li>You now should have a checkout on disk inside a project to work from in eclipse</li>
</ul>
<p><strong>Development environment side:</strong></p>
<ul>
<li>Create and setup a LAMP based virtual server.  (I&#8217;m going to assume ubuntu because that&#8217;s what I&#8217;ve used)</li>
<li>Create a virtual host for your project.</li>
</ul>
<p><strong>The actual interesting bit:</strong></p>
<p>Now the above is really standard stuff, so that&#8217;s why it&#8217;s a bit brief, but now comes the interesting bit.</p>
<p>What we want to do is mount the code checkout from your client machine as the serving directory of your development environment. Because I&#8217;m lazy I want to be able to do this with one click of the button, so we are going to break some security things to be able to do this via the browser.</p>
<p>We want the apache user (www-data in my case) to be able to mount via sshfs and unmount. This will enable it to mount the checkout from my client pc to the serving directory of apache on the virtual server.</p>
<p>First we want to add www-data to the fuse usergroup, we do this via the following command.</p>
<blockquote><p><code>sudo usermod -G fuse www-data</code></p></blockquote>
<p>Now the www-data user will be allowed to use sshfs.</p>
<p>Next we create the file <em>/var/www/index.php</em> and put some code into it. The following code is really simple and could probably be made more elegant but currently I don&#8217;t care <img src='http://www.underdevelopment.eu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<blockquote><p><code><br />
&lt;?</p>
<p>if ($_GET['mount']=='myproject' )<br />
&nbsp;&nbsp;`sshfs user@192.168.1.20:/home/demo/workspace/myproject /var/www/myproject`;</p>
<p>if ($_GET['umount']=='myproject')<br />
&nbsp;&nbsp;`sudo umount /var/www/myproject/`;</p>
<p>if (is_file('/var/www/myproject/index.php'))<br />
{<br />
?&gt;<br />
myproject is currently mounted -- &lt;a href="?umount=myproject" /&gt;umount&lt;/a&gt;<br />
&lt;?<br />
}else{<br />
?&gt;<br />
myproject is currently not mounted -- &lt;a href="?mount=myproject" /&gt;mount&lt;/a&gt;<br />
&lt;?<br />
}<br />
</code></p></blockquote>
<p>What this allows us to do is to go to the default hosts index.php and remotely tell the server to mount or unmount the environment. There are a few things we need to do to actually make the above code work though.</p>
<p>First the mounting.<br />
sshfs uses ssh, so since we want to use it without user interaction we need to create a private and public key for www-data. </p>
<blockquote><p><code><br />
sudo su - www-data<br />
/bin/bash<br />
ssh-keygen<br />
</code></p></blockquote>
<p>After that you should have a set of keys, then copy the public key to your client and add it in <em>~/.ssh/authorized_keys</em> of the user you need to log into.</p>
<p>Now the mounting of the repository should work. </p>
<p>However for the unmounting we need to use sudo to get the rights to do that. So for that we need to edit /etc/sudoers on the virtual server and add the following line somewhere.</p>
<blockquote><p><code>www-data ALL = NOPASSWD: ALL</code></p></blockquote>
<p>Yes, it would be much safer to not allow ALL, but only the umount, but for my virtual development box i&#8217;m really not concerned with security, I just want a trouble free and quick fix.</p>
<p>So now I created a simple script that will let me mount and unmount my working copy of the code on the virtual server.</p>
<p>I typed this all up rather quickly so if anyone wants some parts explained in some more detail just leave a comment.</p>
<img src="http://feeds.feedburner.com/~r/underdevelopment/AdPR/~4/hlLL2LeTegg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2009/08/13/setting-up-simple-but-easy-to-work-with-lamp-development-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.underdevelopment.eu/2009/08/13/setting-up-simple-but-easy-to-work-with-lamp-development-environment/</feedburner:origLink></item>
		<item>
		<title>Oh, I knew about that</title>
		<link>http://feedproxy.google.com/~r/underdevelopment/AdPR/~3/k6wP0IfDMCQ/</link>
		<comments>http://www.underdevelopment.eu/2009/04/10/oh-i-knew-about-that/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 23:57:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[broken window]]></category>
		<category><![CDATA[pragmatic programmer]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=95</guid>
		<description><![CDATA[Now this piece of wisdom is actually not mine, but from a colleague at ibuildings. He basically states the following; &#8220;If a client or user ever finds a bug or a security hole, then don&#8217;t ever say &#8216;Oh, i knew about that&#8217;.&#8221; Now the observation here is that sometimes while you are reading older code [...]]]></description>
			<content:encoded><![CDATA[<p>Now this piece of wisdom is actually not mine, but from a colleague at <a href="http://www.ibuildings.com/">ibuildings</a>. He basically states the following; <strong>&#8220;If a client or user ever finds a bug or a security hole, then don&#8217;t ever say &#8216;Oh, i knew about that&#8217;.&#8221;<br />
</strong><br />
Now the observation here is that sometimes while you are reading older code you will see a bug or security leak. Often enough you will think &#8220;Oh well, this is old code and has been running for years&#8221;. That however is not the right thought to have.</p>
<p>The right thing to do is to estimate how many hours would be needed to fix it and what the impact of the problem is. If you then have enough time, you fix it. If you don&#8217;t, you register it and escalate it to the person responsible of the project. </p>
<p>At least then, you don&#8217;t have to say &#8220;Oh, I knew about that&#8221;. This phenomena is closely related to that of the <a href="http://www.pragprog.com/the-pragmatic-programmer/extracts/software-entropy">broken window effect</a>*, which teaches us that it is human nature to not fix the window. It is therefore wise to always keep the above in mind, and consciously force yourself to do the right thing.</p>
<p>So next time you see a bug, don&#8217;t say to yourself that you will fix it next week, because we both know that will probably never happen.</p>
<p><em>* This effect is wonderfully described in the book &#8216;<a href="http://www.pragprog.com/the-pragmatic-programmer">the pragmatic programmer</a>&#8216;, required reading for any programmer if it was up to me.</em></p>
<img src="http://feeds.feedburner.com/~r/underdevelopment/AdPR/~4/k6wP0IfDMCQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2009/04/10/oh-i-knew-about-that/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.underdevelopment.eu/2009/04/10/oh-i-knew-about-that/</feedburner:origLink></item>
		<item>
		<title>object oriented programming, encapsulation and the command pattern</title>
		<link>http://feedproxy.google.com/~r/underdevelopment/AdPR/~3/GMh9xlhsVA4/</link>
		<comments>http://www.underdevelopment.eu/2009/03/21/object-oriented-programming-encapsulation-and-the-command-pattern/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 19:52:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[command pattern]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[object oriented programming]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=92</guid>
		<description><![CDATA[First you will have to excuse me for last week, while it is my intention to write at least one blog post a week, real life and more specifically a current project at my job have had me tied up quite a bit I&#8217;m afraid. Also in the interested of actually writing about something people [...]]]></description>
			<content:encoded><![CDATA[<p>First you will have to excuse me for last week, while it is my intention to write at least one blog post a week, real life and more specifically a current project at my job have had me tied up quite a bit I&#8217;m afraid.</p>
<p>Also in the interested of actually writing about something people would want to read, I am paying special attention to the popularity of my blog posts. Since at the moment I have only 4 posts and about roughly the same amount of visitors, I can hardly make any real conclusions from that data. However even with numbers as low as those, it seems my blog post about object oriented programming is by far the most popular. This could be skewed for many reasons, but for the moment I will assume it is true. If any of the four people whom read this blog would like me to address some other topic, then please do use the comments and I will see what I can tell about the subject.</p>
<p>Now with all that said, it will come to no surprise that I will try to explain a little bit about object oriented programming. Specifically, as the title already betrays, about encapsulation and the command pattern. Now I know I already briefly touched on that topic in my previous blog about <a href="http://www.underdevelopment.eu/2009/02/21/object-oriented-programming-and-design-patterns-my-first-steps/">OOP and patterns</a>, but I just like it and it is my blog.</p>
<p>So what is encapsulation, and why should you care?</p>
<p>Encapsulation is, as the word describes, the idea that functionality and data should be encapsulated within its own domain. This, at least in my eyes, is the single most important and single most beneficial aspect of object oriented programming. In a way it even defines what object oriented actually is.<br />
A object is a representation of a distinct entity of your program, which <strong>encapsulates</strong> its behaviour. Thereby abstracting the functionality and making it easier to work with and think about.</p>
<p>Now that is all well and fine, but why  would I want to encapsulate, you ask,? Well depending on your level of experience with existing code the answer should already be painfully clear. Just think back about that project that was built years ago, which kept getting more feature requests until the initial functional design in no way represented the project as it is now. Such projects often suffer from bad encapsulation, different parts that intertwine way too much with each other. Making it expensive in time to add/remove or even modify features.</p>
<p>That is exactly what encapsulation fights. By correctly encapsulating behaviour you guarantee that none of the encapsulated functionality is touched upon elsewhere in the project. You effectively limit the domain it has effect upon.</p>
<p>Many if not all design patterns embrace the idea of encapsulation but I think the command pattern does so in the most direct way. The command pattern as I explained in a previous blog post encapsulates a piece of functionality exposing only a common method to call it, this is useful in many ways. Think for instance about &#8220;actions&#8221; that need to be executed or as a specific example the image manipulations from my previous blog. I could have put knowledge about those things in the object that handled the images as collection. That however would have meant that that object now, not only has to know about the images, but also about how to manipulate them. That may sound minor, but in reality that would in fact give a single object two responsibilities. Now while I do not have direct proof, I can guarantee you that however elegant it might initially be written over time the object would get encumbered with even more functionality for manipulating images.</p>
<p>However if the manipulation of images is in fact fully encapsulated within a separate object that bears the responsibility to do just that one action, we force ourselves to keep that functionality within that object. Meaning that however much we might change the way those images are manipulated we will never need to touch the object that controls the collection of images.  We could for instance easily switch from using GDlib to libMagick. The only thing we would need to do is modify the command objects and perhaps their parent object which might contain shared functionality.</p>
<p>You might even imagine we could keep both these versions and detect up-front what modules are available to us and choose which set of command objects to use, depending on that. If we had not used the command pattern it would not be unthinkable that this choice would also have ended up in the object that initially only held the images, thus creating the start of the wild growth that would eventually lead to a super sized object that might hold half of the project functionality.</p>
<p>-edit-</p>
<p>Disabled comments because I was only getting spam. If you want to comment just do so on another article and add that it was actually for this one and i&#8217;ll move it or something.</p>
<img src="http://feeds.feedburner.com/~r/underdevelopment/AdPR/~4/GMh9xlhsVA4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2009/03/21/object-oriented-programming-encapsulation-and-the-command-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.underdevelopment.eu/2009/03/21/object-oriented-programming-encapsulation-and-the-command-pattern/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 4.680 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-08-14 06:58:10 -->
