<?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>Active Developer</title>
	<atom:link href="http://activedeveloper.info/feed" rel="self" type="application/rss+xml" />
	<link>http://activedeveloper.info</link>
	<description>coding for fun and profit</description>
	<lastBuildDate>Sun, 01 Jan 2012 12:37:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Addendum to function currying</title>
		<link>http://activedeveloper.info/addendum-to-function-currying</link>
		<comments>http://activedeveloper.info/addendum-to-function-currying#comments</comments>
		<pubDate>Tue, 11 Oct 2011 20:01:53 +0000</pubDate>
		<dc:creator>mhitza</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Discussion]]></category>
		<category><![CDATA[curry]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[partial function application]]></category>

		<guid isPermaLink="false">http://activedeveloper.info/?p=855</guid>
		<description><![CDATA[In my last post I&#8217;ve tried to explain the differences between partial function application and function currying. The post was more generally addressed to JavaScript developers (as an accompanying material to a presentation I&#8217;m working on) so I&#8217;ve tried to &#8230; <a href="http://activedeveloper.info/addendum-to-function-currying">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my last post I&#8217;ve tried to explain the differences between partial function application and function currying. </p>
<p>The post was more generally addressed to JavaScript developers (as an accompanying material to a presentation I&#8217;m working on) so I&#8217;ve tried to keep the text as practical as possible in the context of JavaScript programming.</p>
<p>But as I remarked on, the post wasn&#8217;t academically correct, more precisely the examples I&#8217;ve used had a specific purpose of <q>incorrectness<q>. Skipping that part for now, let&#8217;s just see what exactly currying means to its true definition.</p>
<blockquote><p>
In mathematics and computer science, currying is the technique of transforming a function that takes multiple arguments (or an n-tuple of arguments) in such a way that it can be called as a chain of one argument functions.
</p></blockquote>
<p><span id="more-855"></span><br />
If we where true to that definition, a function <code>add(a, b, c, d)</code> in a curried form would actually be representable in JavaScript under the following form:<br />
<script src="https://gist.github.com/1279104.js"> </script></p>
<p>Now, for a second let&#8217;s suppose that we could actually curry a function to that form. As far as I was able to reason and do, the only possible variant was a curry function with <q>on-demand</q> currying.<br />
<script src="https://gist.github.com/1272823.js"> </script></p>
<p>I&#8217;ve tried my best with that one without succumbing to tempting human sacrifice. Some javascripters with knowledge in JavaScript&#8217;s darker arts may enlighten me on a better implementation; I have no doubts in such a thing.</p>
<p>Anyway let&#8217;s see that <code>curry</code> function in action:<br />
<script src="https://gist.github.com/1279163.js"> </script></p>
<p>While an interesting hack, it&#8217;s far away from being a <code>curry</code> function. In fact, there is no single <code>curry</code> function in any JavaScript library, no matter how functional it calls itself. Search for curry in these libraries documentation  <a href="http://osteele.com/sources/javascript/functional/">here</a>, where the author is even nice enough to offer an explication:</p>
<blockquote><p>
Note that, unlike in languages with true partial application such as Haskell, curry and uncurry are not inverses. This is a cause to the fact that in JavaScript, unlike Haskell, a fully saturated function is not equivalent to the value that it returns. The definition of curry here matches semantics that most people have used when implementing curry for procedural languages.
</p></blockquote>
<p>And you could pick the <a href="http://api.prototypejs.org/language/Function/prototype/curry/">Prototype</a> documentation, or the one for <a href="http://documentcloud.github.com/underscore/#bind">underscore</a> and you&#8217;d get the similarity between them and the one in my earlier article; but they are still not <strong>the</strong> currying function.</p>
<p>Anyway, what I&#8217;m trying to go at, their role in JavaScript serves as partial application functions; that being the basis of my previous post, where in spite of incorrectness, I wanted to make it clear that there is difference between the two that is not generally very clear to new developers (without functional programming knowledge, that is).</p>
<p>In the voice of a great man, <q><a href="http://www.youtube.com/watch?v=D6Bge3xxrGY">Live long and prosper</a></q></p>
<hr />
Currying definition: <a href="http://en.wikipedia.org/wiki/Currying">http://en.wikipedia.org/wiki/Currying</a><br />
Functional javascript library documentation: <a href="http://osteele.com/sources/javascript/functional/">http://osteele.com/sources/javascript/functional/</a><br />
Prototype function curry documentation: <a href="http://api.prototypejs.org/language/Function/prototype/curry/">http://api.prototypejs.org/language/Function/prototype/curry/</a><br />
Underscore function bind documentation: <a href="http://documentcloud.github.com/underscore/#bind">http://documentcloud.github.com/underscore/#bind</a></p>
]]></content:encoded>
			<wfw:commentRss>http://activedeveloper.info/addendum-to-function-currying/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Differentiating between function currying and partial function application</title>
		<link>http://activedeveloper.info/differentiating-between-function-currying-and-partial-function-application</link>
		<comments>http://activedeveloper.info/differentiating-between-function-currying-and-partial-function-application#comments</comments>
		<pubDate>Sat, 08 Oct 2011 14:03:36 +0000</pubDate>
		<dc:creator>mhitza</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Insight]]></category>
		<category><![CDATA[closure]]></category>
		<category><![CDATA[curry]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[higher order function]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[partial function application]]></category>

		<guid isPermaLink="false">http://activedeveloper.info/?p=817</guid>
		<description><![CDATA[With the recent rise of functional programming (in recent years) a lot of concepts have made their way into mainstream programming languages. Higher order functions, closures, partial function applications, currying; just to name a few. But from all these concepts, &#8230; <a href="http://activedeveloper.info/differentiating-between-function-currying-and-partial-function-application">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>With the recent rise of functional programming (in recent years) a lot of concepts have made their way into mainstream programming languages. Higher order functions, closures, partial function applications, currying; just to name a few.</p>
<p>But from all these concepts, the last two seem to be in many places used interchangeably, or so may they seem from various articles and code snippets spread over the internet. Don&#8217;t get me wrong, I am responsible for such confusion myself, and my co-workers can blame me for it on that time when I tried to explain partial function application.</p>
<p>That, ends today, because I&#8217;ve gotten my facts right and demistified these two strange concepts that seamingly do the same thing.<span id="more-817"></span><br />
Now, in order to get this started I&#8217;d think the best approach should be to start with a formal definition:</p>
<blockquote><p>
In computer science, partial application (or partial function application) refers to the process of fixing a number of arguments to a function, producing another function of smaller arity. Given a function <code>f:(X × Y × Z) → N</code> , we might fix (or &#8216;bind&#8217;) the first argument, producing a function of type <code>partial(f):(Y × Z) → N</code>. Evaluation of this function might be represented as <code>f<sub>partial</sub>(2,3)</code>. Note that the result of partial function application in this case is a function that takes two arguments.
</p></blockquote>
<blockquote><p>
Given a function f of type <code>f:(X × Y) → Z</code> , currying it makes a function <code>curry(f):X → (Y → Z)</code>. That is, <code>curry(f)</code> takes an argument of type <code>X</code> and returns a function of type <code>Y → Z</code> .
</p></blockquote>
<p>Where the following definitions could be used for <abbr title="partial application">papply</abbr> and curry:<br />
<code>
<pre>
papply  : (((a × b) → c) × a) → (b → c)
curry   : ((a × b) → c) → (a → (b → c))
</pre>
<p></code></p>
<p>Now let&#8217;s try to define these two functions in JavaScript (the only programming language that everybody knows?)<br />
<script src="https://gist.github.com/1272299.js"> </script></p>
<p>Before we can safely proceed onwards let&#8217;s fiddle around with these two functions in order to get the hang of it:<br />
<script src="https://gist.github.com/1272303.js"> </script></p>
<p>As you can deduce from the sample code above, it is very clear that in our case we can define one as an application of the other. And let&#8217;s do just that with our <code>papply</code> function.<br />
<script src="https://gist.github.com/1272307.js"> </script></p>
<p>Partial application <strong>IS</strong> dependent on function currying. And if we&#8217;d done our implementation correctly, the following equation should hold true:<br />
<code>
<pre>
curry papply = curry
</pre>
<p></code></p>
<p>Again using our previously defined functions (including <code>add</code>) we&#8217;ll see if we got it right:<br />
<script src="https://gist.github.com/1272310.js"> </script></p>
<p>I highly recommend playing with the code in either Firebug or <a href="http://jsfiddle.net/">JsFiddle</a> to get the hang of it.</p>
<hr />
Source of formal and mathematical definitions <a href="http://en.wikipedia.org/wiki/Partial_application">http://en.wikipedia.org/wiki/Partial_application</a>, <a href="http://en.wikipedia.org/wiki/Currying">http://en.wikipedia.org/wiki/Currying</a></p>
]]></content:encoded>
			<wfw:commentRss>http://activedeveloper.info/differentiating-between-function-currying-and-partial-function-application/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A simple symfony 1.4 URL validator</title>
		<link>http://activedeveloper.info/a-simple-symfony-1-4-url-validator</link>
		<comments>http://activedeveloper.info/a-simple-symfony-1-4-url-validator#comments</comments>
		<pubDate>Mon, 27 Jun 2011 03:41:46 +0000</pubDate>
		<dc:creator>mhitza</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://activedeveloper.info/?p=792</guid>
		<description><![CDATA[A 0.5 improvement, is still an improvement. As much as we&#8217;d like people to strictly fill in data into forms, they get annoyed and complain when the http:// prefix is mandatory. As such I had to create my own validator &#8230; <a href="http://activedeveloper.info/a-simple-symfony-1-4-url-validator">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A 0.5 improvement, is still an improvement.</p>
<p>As much as we&#8217;d like people to strictly fill in data into forms, they get annoyed and complain when the <code>http://</code> prefix is mandatory. As such I had to create my own validator which is a little more permissive over symfony&#8217;s default URL validator.</p>
<p><script src="https://gist.github.com/1048263.js"> </script></p>
<p><small>Sometimes I really find user feedback bothersome.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://activedeveloper.info/a-simple-symfony-1-4-url-validator/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sleepsort</title>
		<link>http://activedeveloper.info/sleepsort</link>
		<comments>http://activedeveloper.info/sleepsort#comments</comments>
		<pubDate>Wed, 15 Jun 2011 17:46:37 +0000</pubDate>
		<dc:creator>mhitza</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sleepsort]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://activedeveloper.info/?p=788</guid>
		<description><![CDATA[It simply amazed me the cleverness that this guy on 4chan had when writing this algorithm. For each number in the list, it spawns a process waiting an amount of time equal with the number received and afterwards prints its. &#8230; <a href="http://activedeveloper.info/sleepsort">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It simply amazed me the cleverness that this guy on 4chan had when writing this algorithm.</p>
<p>For each number in the list, it spawns a process waiting an amount of time equal with the number received and afterwards prints its.</p>
<p><script src="https://gist.github.com/1027641.js"> </script></p>
<p>Brilliant, I would say. </p>
]]></content:encoded>
			<wfw:commentRss>http://activedeveloper.info/sleepsort/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeJam, a lesson in Haskell IO</title>
		<link>http://activedeveloper.info/codejam-a-lesson-in-haskell-io</link>
		<comments>http://activedeveloper.info/codejam-a-lesson-in-haskell-io#comments</comments>
		<pubDate>Sun, 08 May 2011 10:04:39 +0000</pubDate>
		<dc:creator>mhitza</dc:creator>
				<category><![CDATA[Challenge]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[codejam]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[haskell]]></category>

		<guid isPermaLink="false">http://activedeveloper.info/?p=775</guid>
		<description><![CDATA[As you may know yesterday took place the qualification round for the Google Code Jam contest. While it&#8217;s start time was around 2AM in my timezone I felt pretty excited to participate, given that my objective was to use Haskell &#8230; <a href="http://activedeveloper.info/codejam-a-lesson-in-haskell-io">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As you may know yesterday took place the qualification round for the Google Code Jam contest. While it&#8217;s start time was around 2AM in my timezone I felt pretty excited to participate, given that my objective was to use Haskell and get better in it.<br />
<span id="more-775"></span><br />
From the problems that where exposed, Goro sort was the single one which I had managed to complete; not in the 24h span, but in my spare time, I had a pretty busy schedule this Saturday.</p>
<p><strong>So how did it go?</strong></p>
<p>Well, once the problem clicked the solution was writable in a couple of minutes (like of what I assume was the case with most of the problems); but never having played with IO before in Haskell (of course I&#8217;m still a beginner) I copy pasted the input &#8211; output routine from <a href="http://book.realworldhaskell.org/read/io.html">Real World Haskell</a>.</p>
<p>My solution looked marvelous:<br />
<script src="https://gist.github.com/961259.js"> </script></p>
<p>Until today when I&#8217;ve seen rst76&#8242;s solution:<br />
<script src="https://gist.github.com/961267.js"> </script></p>
<p>And found about <code>interact</code>. Now marvelous doesn&#8217;t quite fit as a description for my solution.</p>
<p><small>note to self: y u no read complete page?</small></p>
]]></content:encoded>
			<wfw:commentRss>http://activedeveloper.info/codejam-a-lesson-in-haskell-io/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flavius Josephus in Haskell</title>
		<link>http://activedeveloper.info/flavius-josephus-in-haskell</link>
		<comments>http://activedeveloper.info/flavius-josephus-in-haskell#comments</comments>
		<pubDate>Thu, 28 Apr 2011 23:08:35 +0000</pubDate>
		<dc:creator>mhitza</dc:creator>
				<category><![CDATA[Challenge]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[josephus]]></category>

		<guid isPermaLink="false">http://activedeveloper.info/?p=766</guid>
		<description><![CDATA[My first Haskell solution for a programming praxis challenge, and this time I almost nailed it. Almost, because even with a clear specification of the expected result I still managed to lose focus for a moment, and went for a &#8230; <a href="http://activedeveloper.info/flavius-josephus-in-haskell">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My first Haskell solution for a programming praxis challenge, and this time I almost nailed it.</p>
<p>Almost, because even with a clear specification of the expected result I still managed to lose focus for a moment, and went for a &#8220;fancy&#8221; solution that doesn&#8217;t quite qualify as a solution. What I want to say is that instead of returning a list ordered with the people who have died, I have only returned the last person killed.<br />
<span id="more-766"></span></p>
<p>The &#8220;fancy&#8221; part of it is, that it returns the last person killed by solving the problem for each varying number of people from <code>1..n</code>.</p>
<p>Considering it&#8217;s 2AM, I&#8217;m going to leave it as it is and pretend that everything went better than expected :)</p>
<p><script src="https://gist.github.com/947521.js"> </script></p>
<p>For the correct Haskell solution <a href="http://programmingpraxis.com/2009/02/19/flavius-josephus/">check the first comment on the challenge page</a>.</p>
<p>Also found a couple of <a href="http://www.reddit.com/r/haskell/comments/7w04j/learning_haskell_solving_the_josephus_flavius_game">variations of the Haskell solution on reddit</a>.</p>
<p><small>P.S.I would have had it right if I would have sticked with my first idea consisting of a cycled list and an incrementing step.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://activedeveloper.info/flavius-josephus-in-haskell/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ackermann function in Haskell</title>
		<link>http://activedeveloper.info/the-ackermann-function-in-haskell</link>
		<comments>http://activedeveloper.info/the-ackermann-function-in-haskell#comments</comments>
		<pubDate>Wed, 20 Apr 2011 20:41:46 +0000</pubDate>
		<dc:creator>mhitza</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[haskell]]></category>

		<guid isPermaLink="false">http://activedeveloper.info/?p=750</guid>
		<description><![CDATA[While the Ackermann function is a trivial one to write, it made me realize something today. Instead of a pure mathematical definition, my mind I had it directly mapped to Haskell code. And no Haskell book I&#8217;ve read had developed &#8230; <a href="http://activedeveloper.info/the-ackermann-function-in-haskell">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While the <a href="http://en.wikipedia.org/wiki/Ackermann_function">Ackermann function</a> is a trivial one to write, it made me realize something today.<br />
<span id="more-750"></span><br />
Instead of a pure mathematical definition, my mind I had it directly mapped to Haskell code. And no Haskell book I&#8217;ve read had developed on this obvious transformation. Sure, they say it&#8217;s built on mathematical abstractions, but they never place them side by side.</p>
<p>I&#8217;d rather have Haskell books that first point out the mathematical abstraction, and afterwards actual Haskell code. Just inspect for yourselves the following two function definitions.<br />
<a href="http://activedeveloper.info/wp-content/uploads/2011/04/ackermann-function.png"><img src="http://activedeveloper.info/wp-content/uploads/2011/04/ackermann-function.png" alt="Ackermann function definition" title="Ackermann function" width="490" height="84" /></a><br />
<script src="https://gist.github.com/932767.js"> </script><br />
Now if you&#8217;d only know the basics of function definitions in Haskell, I&#8217;d think that this example would make it very easy for you to understand function guards (and in a broader sense pattern matching).</p>
]]></content:encoded>
			<wfw:commentRss>http://activedeveloper.info/the-ackermann-function-in-haskell/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bingo game in Io language</title>
		<link>http://activedeveloper.info/bingo-game-in-io-language</link>
		<comments>http://activedeveloper.info/bingo-game-in-io-language#comments</comments>
		<pubDate>Sat, 16 Apr 2011 10:52:27 +0000</pubDate>
		<dc:creator>mhitza</dc:creator>
				<category><![CDATA[Challenge]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[bingo]]></category>
		<category><![CDATA[io-language]]></category>

		<guid isPermaLink="false">http://activedeveloper.info/?p=741</guid>
		<description><![CDATA[This is the third chronological challenge from ProgrammingPraxis, and this challenge took the most time to complete given I it was the first program I wrote in the Io language Without further due here is the Io version of the &#8230; <a href="http://activedeveloper.info/bingo-game-in-io-language">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is the third chronological challenge from ProgrammingPraxis, and this challenge took the most time to complete given I it was the first program I wrote in the <a href="http://www.iolanguage.com/">Io language</a><br />
<span id="more-741"></span><br />
Without further due here is the <a href="http://programmingpraxis.com/2009/02/19/bingo/">Io version of the Bingo game</a>:<br />
<script src="https://gist.github.com/923040.js"> </script><br />
<br />
<small>P.S. it takes a lot to complete. I&#8217;ve run it in the morning and it was done when I came back from work.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://activedeveloper.info/bingo-game-in-io-language/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FTP, PHP and leaky abstractions</title>
		<link>http://activedeveloper.info/ftp-php-leaky-abstractions</link>
		<comments>http://activedeveloper.info/ftp-php-leaky-abstractions#comments</comments>
		<pubDate>Tue, 12 Apr 2011 22:45:24 +0000</pubDate>
		<dc:creator>mhitza</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[Insight]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[leaky abstraction]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://activedeveloper.info/?p=726</guid>
		<description><![CDATA[To be honest until recently I never gave much taught on FTPs way of working. Sure I&#8217;ve used it for a long time, and tried to minimize it&#8217;s use for an even longer period; but sometimes you just get things &#8230; <a href="http://activedeveloper.info/ftp-php-leaky-abstractions">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To be honest until recently I never gave much taught on FTPs way of working. Sure I&#8217;ve used it for a long time, and tried to minimize it&#8217;s use for an even longer period; but sometimes you just get things as granted.<br />
<br />
Due to some events that took place last week I realized how leaky the FTP libraries actually are.<br />
<span id="more-726"></span><br />
Now, some will disagree with me and I as well reflected much on this idea before posting it, I firmly believe that libraries are abstractions. Leaky abstractions, as we will shall see in a few moments.<br />
<br />
As I was saying, last week we had to migrate our application to the &#8220;cloud&#8221; (whatever that means) and among the many things our application does there are a few batch processes that retrieve content for our application from different sources. Among those sources a couple of FTP servers can be counted.<br />
<br />
Through the testing phase, we found out that several of these services broke, more precisely those which interacted with external FTP servers. It took us some time to realize that the issue was caused by the firewall sitting in front of our application which didn&#8217;t allow our application to use the privileged <a href="http://en.wikipedia.org/wiki/File_Transfer_Protocol#Protocol_overview">port 20</a>.<br />
<br />
As you could find out in a couple of seconds overcoming this problem is in most cases as simple as setting the FTP connection in passive mode. One line in three scripts and we where done:</p>
<p><script src="https://gist.github.com/916528.js"> </script><br />
</p>
<h2>Or were we?</h2>
<p>
Some may have known this, or would have read the whole page in the PHP manual, but setting the connection to passive mode has practically no effect if it is issued before the user is logged in. So the correct solution was:<br />
<script src="https://gist.github.com/916549.js"> </script><br />
<br />
<em>If you would still like to say that the FTP library is a mere protocol implementation, just think that it offers non blocking procedures and handling of FTP SSL connections. The later being part of a different RFC than the FTP protocol.</em><br />
<br />
And it does not stop here, even when people <a href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Ftp+-+Steven+Brown">abstract further away the FTP library</a> they still stick with the same leaked implementation detail. Sure, the command pattern would be a good candidate for a solution, but what argument could one give to make them add a bit more complexity in their abstraction for a disputable benefit.<br />
<br />
No one, and that is why the current state of development consists of leaks all the way down.</p>
]]></content:encoded>
			<wfw:commentRss>http://activedeveloper.info/ftp-php-leaky-abstractions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Subversion horror story</title>
		<link>http://activedeveloper.info/a-subversion-horror-story</link>
		<comments>http://activedeveloper.info/a-subversion-horror-story#comments</comments>
		<pubDate>Thu, 10 Mar 2011 00:12:39 +0000</pubDate>
		<dc:creator>mhitza</dc:creator>
				<category><![CDATA[Insight]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://activedeveloper.info/?p=694</guid>
		<description><![CDATA[Every once in a while the stars align for one, and only one single purpose; to drive developers in the twilight zone of bug madness. Unlike many other occurrences, this time the problem wasn&#8217;t code related, it all happened at &#8230; <a href="http://activedeveloper.info/a-subversion-horror-story">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Every once in a while the stars align for one, and only one single purpose; to drive developers in the twilight zone of bug madness. Unlike many other occurrences, this time the problem wasn&#8217;t code related, it all happened at the version control level.<br />
<span id="more-694"></span><br />
It all started a couple of weeks ago, when a feature I have developed on my branch had to be deployed on our test servers. Nothing fancy, a simple switch from trunk to my branch. And surely, at the rapid pace we develop software (weekly releases) my colleagues as well had to deploy their modifications on the test server.</p>
<p>Piece of cake I said, made another branch from the trunk and integrated my branch in it, conducted a svn branching/merging 101 workshop to my team mates (which have never used/heard of branches/tags before), and wrote a document on the steps required for merging new code from trunk to the branch deployed on our test environment. Gave the most basic rule to follow:</p>
<blockquote><p>
Always before switching make sure no local modifications exist. Diff and revert if necessary, but don&#8217;t switch around until your local copy is clean.
</p></blockquote>
<p>Two weeks in everything seemed fine. Then BOOM, the seed was planted; because one day one of the developers, and I&#8217;m not going to point fingers, made a commit without the files generated by our ORM. Someone else noticed it after deploying the code on production and running the ORM code generator. Being asked about it I said the solution is simple:</p>
<blockquote><p>Just add the files to subversion and you&#8217;re done with it.</p></blockquote>
<p>Without other questions they poured a bit of water on the seed, by adding the files not on trunk, but on the branch from our test environment. Day was over, it was time to go home. Next day, back in the office and I&#8217;m asked why subversion has flagged more files that the ones that where changed on trunk since the last merge.</p>
<blockquote><p>
It&#8217;s just svn, version 1.5.x really likes to go nuts with mergeinfo properties.
</p></blockquote>
<p>And the seed flourished.<br />
Minutes later stuff, that shouldn&#8217;t have, got broken on our test server&#8230; what? One look into subversions log and almost all files have gotten property changes upon the last merge.</p>
<p>The reason? The subversion switch from trunk to branch got broken somewhere, leaving around a large number of files still pointing to trunk. And as with the mechanical way they followed my written down merging operations issued a commit, task finished.</p>
<p>But what&#8217;s the seed got to do with this? The only reason the switch failed was because the mentioned ORM generated files where unversioned on trunk, but had incoming adds upon the switch.</p>
<p>Three hours in, I brought back the code to stable version on both branch and trunk (committing was done to both due to the partial switch).</p>
<p>But no, the story doesn&#8217;t end here. Even after stabilizing both source trees, another problem popped up, I could no longer synchronize the branch with trunk. The all so <a href="http://old.nabble.com/conflict-on-merge--td21392427.html">mystical mergeinfo property conflict</a> appeared.<br />
<br />
The now tired developer used:<code> svn merge trunk --accept theirs-full </code><br />
It was super effective.<br />
<br />
<small>p.s. Might have not sounded too horrific for you, but I remember the face my project manager made when I tried to explain him the issues.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://activedeveloper.info/a-subversion-horror-story/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.287 seconds -->

