<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: A little more wisdom</title>
	<atom:link href="http://www.dadhacker.com/blog/?feed=rss2&#038;p=1117" rel="self" type="application/rss+xml" />
	<link>http://www.dadhacker.com/blog/?p=1117</link>
	<description>Instant wisdom about any random thing I feel like.</description>
	<lastBuildDate>Sat, 21 Aug 2010 16:53:56 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tom</title>
		<link>http://www.dadhacker.com/blog/?p=1117&#038;cpage=1#comment-48235</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Sat, 13 Jun 2009 10:08:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=1117#comment-48235</guid>
		<description>A colleague of mine was investigating a really elusive bug that caused the system to crash after a long period of uptime. After weeks of investigation, no clear way to reproduce the problem he found the following while trawling through the code:

if (!obscure_edge_case);
{
    do_something();
}

The semicolon after the &#039;if&#039; meant that the block would always get executed regardless of the condition. He removed that one character and everything worked perfectly from then on. Weeks of bughunting resulted in a single char being changed. There were some red faces from the team responsible for the original code.</description>
		<content:encoded><![CDATA[<p>A colleague of mine was investigating a really elusive bug that caused the system to crash after a long period of uptime. After weeks of investigation, no clear way to reproduce the problem he found the following while trawling through the code:</p>
<p>if (!obscure_edge_case);<br />
{<br />
    do_something();<br />
}</p>
<p>The semicolon after the &#8216;if&#8217; meant that the block would always get executed regardless of the condition. He removed that one character and everything worked perfectly from then on. Weeks of bughunting resulted in a single char being changed. There were some red faces from the team responsible for the original code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bill</title>
		<link>http://www.dadhacker.com/blog/?p=1117&#038;cpage=1#comment-46587</link>
		<dc:creator>bill</dc:creator>
		<pubDate>Fri, 29 May 2009 01:35:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=1117#comment-46587</guid>
		<description>OS people get no respect? As a former one married to a still-one, I know this: they&#039;re lucky to have a job. People in neat suits are trying to figure out how to get rid of them, all the time.  And succeeding, too.</description>
		<content:encoded><![CDATA[<p>OS people get no respect? As a former one married to a still-one, I know this: they&#8217;re lucky to have a job. People in neat suits are trying to figure out how to get rid of them, all the time.  And succeeding, too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harborpirate</title>
		<link>http://www.dadhacker.com/blog/?p=1117&#038;cpage=1#comment-46555</link>
		<dc:creator>harborpirate</dc:creator>
		<pubDate>Thu, 28 May 2009 19:59:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=1117#comment-46555</guid>
		<description>This is so true. I remember spending many hours searching for the source of a bug that caused the graphics for a .Net app to go all haywire when the DPI setting of the machine was set to a non-standard setting. I kept coming back to the problem, and yet my google-fu could not penetrate its mysteries. Finally a tangential search revealed the key to the problem. The fix turned out to be one line of code. Probably 25 characters inserted into the base assembly fixed a problem that had been outstanding for months.</description>
		<content:encoded><![CDATA[<p>This is so true. I remember spending many hours searching for the source of a bug that caused the graphics for a .Net app to go all haywire when the DPI setting of the machine was set to a non-standard setting. I kept coming back to the problem, and yet my google-fu could not penetrate its mysteries. Finally a tangential search revealed the key to the problem. The fix turned out to be one line of code. Probably 25 characters inserted into the base assembly fixed a problem that had been outstanding for months.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atanas Boev</title>
		<link>http://www.dadhacker.com/blog/?p=1117&#038;cpage=1#comment-46395</link>
		<dc:creator>Atanas Boev</dc:creator>
		<pubDate>Wed, 27 May 2009 06:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=1117#comment-46395</guid>
		<description>&quot;Grow a beard and get a real job&quot;</description>
		<content:encoded><![CDATA[<p>&#8220;Grow a beard and get a real job&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashleigh</title>
		<link>http://www.dadhacker.com/blog/?p=1117&#038;cpage=1#comment-46289</link>
		<dc:creator>Ashleigh</dc:creator>
		<pubDate>Tue, 26 May 2009 10:10:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=1117#comment-46289</guid>
		<description>Beware Netscape Syndrome: Lets not fix it by increments, lets start again and so it all &quot;right&quot;.

And so it came to pass that the new one done &quot;right&quot; had so many new defects, that customers hated it (plus the long delay for it to come out), it crashed and burned, and thus became the dooming of Netscape.

Reworking bits of what you have - WITH COMMENTS IN ABOUT THE NASTY BITS is usually a better (though less sexy) way to go.</description>
		<content:encoded><![CDATA[<p>Beware Netscape Syndrome: Lets not fix it by increments, lets start again and so it all &#8220;right&#8221;.</p>
<p>And so it came to pass that the new one done &#8220;right&#8221; had so many new defects, that customers hated it (plus the long delay for it to come out), it crashed and burned, and thus became the dooming of Netscape.</p>
<p>Reworking bits of what you have &#8211; WITH COMMENTS IN ABOUT THE NASTY BITS is usually a better (though less sexy) way to go.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaishaku</title>
		<link>http://www.dadhacker.com/blog/?p=1117&#038;cpage=1#comment-46257</link>
		<dc:creator>Kaishaku</dc:creator>
		<pubDate>Tue, 26 May 2009 03:46:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=1117#comment-46257</guid>
		<description>Awesome post, Anony.  I&#039;d never do anything like this, of course, but I heard of someone who once designed a program to crash in a very particular and amusing (to me, not to the recipient) way under certain circumstances. :)

The problem I have with &quot;redoing it right&quot; is that:
1. the problem that you sought out to fix by rewriting it from scratch never gets solved
2. the problems you fixed two versions ago and then forgot about are now present again after having been fixed last version
This is basically the bane of open source software, because as jwz notes, rewriting things is &quot;fun,&quot; but finding and fixing bugs is not.</description>
		<content:encoded><![CDATA[<p>Awesome post, Anony.  I&#8217;d never do anything like this, of course, but I heard of someone who once designed a program to crash in a very particular and amusing (to me, not to the recipient) way under certain circumstances. :)</p>
<p>The problem I have with &#8220;redoing it right&#8221; is that:<br />
1. the problem that you sought out to fix by rewriting it from scratch never gets solved<br />
2. the problems you fixed two versions ago and then forgot about are now present again after having been fixed last version<br />
This is basically the bane of open source software, because as jwz notes, rewriting things is &#8220;fun,&#8221; but finding and fixing bugs is not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: landon</title>
		<link>http://www.dadhacker.com/blog/?p=1117&#038;cpage=1#comment-46195</link>
		<dc:creator>landon</dc:creator>
		<pubDate>Mon, 25 May 2009 14:48:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=1117#comment-46195</guid>
		<description>@Anon: Sweet.

Interesting that it always seems easier (and safer) to continue kicking the dead whale down the beach than to re-do it right.

One of the problems with &quot;re-doing it right&quot; is probably the unrestrained featuritis you get.  &quot;As long a we&#039;re in here, we should...&quot; and you&#039;re doomed.</description>
		<content:encoded><![CDATA[<p>@Anon: Sweet.</p>
<p>Interesting that it always seems easier (and safer) to continue kicking the dead whale down the beach than to re-do it right.</p>
<p>One of the problems with &#8220;re-doing it right&#8221; is probably the unrestrained featuritis you get.  &#8220;As long a we&#8217;re in here, we should&#8230;&#8221; and you&#8217;re doomed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anon</title>
		<link>http://www.dadhacker.com/blog/?p=1117&#038;cpage=1#comment-46186</link>
		<dc:creator>Anon</dc:creator>
		<pubDate>Mon, 25 May 2009 13:14:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.dadhacker.com/blog/?p=1117#comment-46186</guid>
		<description>I once worked with a legendary hacker who I&#039;ll call U who would fix &#039;impossible&#039; bugs. Looking at his version control checkins was always a fascinating exercise in sleuthing. He would add code like this

#ifdef DEBUG
_asm(&quot;NOP&quot;);
_asm(&quot;NOP&quot;);
_asm(&quot;NOP&quot;);
_asm(&quot;NOP&quot;);
#endif
_asm(&quot;NOP&quot;);
_asm(&quot;NOP&quot;);
_asm(&quot;NOP&quot;);
_asm(&quot;NOP&quot;);

And fix the bug he was working on.

I asked him about this code and he just laughed. As far as I could tell he needed a &#039;just right&#039; change to make it work. I&#039;m not sure if it was time or space, but clearly the amout of padding was dependent on whether debug was turned on. 

I liked this code he added in a shutdown function

ioctl(commsdev, );

Pulling the handshaking line on the commsdev told the next box up the line that the box had gone away. Now this shouldn&#039;t have been necessary but it turned out the next box up the line had an issue with disconnects in the protocol. 

Anyhow it was a big crufty system, and stuff like this was necessary. The management decided to rewrite it partly to change OS and partly because as one of them told me &#039;we don&#039;t want to be dependent on U&#039;. Anyhow the rewrite was done and U left. Right up until the last minute he was checking in code that was largely incomprehensible. The rewrite obviously didn&#039;t have lots of magic features that only U knew about and was not accepted by most customers.

He had an arch enemy, another legendary hacker who worked as consultant, V. After U left he would come in to fix impossible bugs in the old system and add features. At one point he told me he had the code working in one configuration but discovered that another configuration it would crash and burn. 

He found the code did this

mov ax, cs
cmp ax, d000h
jnz skip1
jmp do_something
skip1:
cmp ax, d800h
jnz skip2
jmp do_something_else
skip2:

I.e. it was designed to allow it to run twice from two different two locations, and do slightly different things depending on where it was. Some things were done from both locations and yet logically on once was necessary. It wasn&#039;t clear if the duplication was be design or was a mistake. As the V put it &quot;when I found this code I was really angry. Whoever wrote it should not only be not paid but they should be fined&quot;. And you could tell who he was talking about. 

Still V got on badly with the management too - he left permanently and very suddenly when they agreed to his extortionate rate when he was working but could not agree to him working unlimited hours. From what I heard the wanted a cap of 50 hours billed per week but he refused to accept that and left at that point. 

Someone else he worked with said he once saw him have a conversation like this with his then boss

Boss: This must be done by June 4th!
V: I&#039;ve explained it before. It&#039;ll be done by June 11th. I&#039;ve shown you a timeplan and June 4th is impossible.
Boss: Unless you tell me it will be done by June 4th, you&#039;re fired
V: Bye!

Needless to say, the code wasn&#039;t done by June 4th. Or June 11th.</description>
		<content:encoded><![CDATA[<p>I once worked with a legendary hacker who I&#8217;ll call U who would fix &#8216;impossible&#8217; bugs. Looking at his version control checkins was always a fascinating exercise in sleuthing. He would add code like this</p>
<p>#ifdef DEBUG<br />
_asm(&#8221;NOP&#8221;);<br />
_asm(&#8221;NOP&#8221;);<br />
_asm(&#8221;NOP&#8221;);<br />
_asm(&#8221;NOP&#8221;);<br />
#endif<br />
_asm(&#8221;NOP&#8221;);<br />
_asm(&#8221;NOP&#8221;);<br />
_asm(&#8221;NOP&#8221;);<br />
_asm(&#8221;NOP&#8221;);</p>
<p>And fix the bug he was working on.</p>
<p>I asked him about this code and he just laughed. As far as I could tell he needed a &#8216;just right&#8217; change to make it work. I&#8217;m not sure if it was time or space, but clearly the amout of padding was dependent on whether debug was turned on. </p>
<p>I liked this code he added in a shutdown function</p>
<p>ioctl(commsdev, );</p>
<p>Pulling the handshaking line on the commsdev told the next box up the line that the box had gone away. Now this shouldn&#8217;t have been necessary but it turned out the next box up the line had an issue with disconnects in the protocol. </p>
<p>Anyhow it was a big crufty system, and stuff like this was necessary. The management decided to rewrite it partly to change OS and partly because as one of them told me &#8216;we don&#8217;t want to be dependent on U&#8217;. Anyhow the rewrite was done and U left. Right up until the last minute he was checking in code that was largely incomprehensible. The rewrite obviously didn&#8217;t have lots of magic features that only U knew about and was not accepted by most customers.</p>
<p>He had an arch enemy, another legendary hacker who worked as consultant, V. After U left he would come in to fix impossible bugs in the old system and add features. At one point he told me he had the code working in one configuration but discovered that another configuration it would crash and burn. </p>
<p>He found the code did this</p>
<p>mov ax, cs<br />
cmp ax, d000h<br />
jnz skip1<br />
jmp do_something<br />
skip1:<br />
cmp ax, d800h<br />
jnz skip2<br />
jmp do_something_else<br />
skip2:</p>
<p>I.e. it was designed to allow it to run twice from two different two locations, and do slightly different things depending on where it was. Some things were done from both locations and yet logically on once was necessary. It wasn&#8217;t clear if the duplication was be design or was a mistake. As the V put it &#8220;when I found this code I was really angry. Whoever wrote it should not only be not paid but they should be fined&#8221;. And you could tell who he was talking about. </p>
<p>Still V got on badly with the management too &#8211; he left permanently and very suddenly when they agreed to his extortionate rate when he was working but could not agree to him working unlimited hours. From what I heard the wanted a cap of 50 hours billed per week but he refused to accept that and left at that point. </p>
<p>Someone else he worked with said he once saw him have a conversation like this with his then boss</p>
<p>Boss: This must be done by June 4th!<br />
V: I&#8217;ve explained it before. It&#8217;ll be done by June 11th. I&#8217;ve shown you a timeplan and June 4th is impossible.<br />
Boss: Unless you tell me it will be done by June 4th, you&#8217;re fired<br />
V: Bye!</p>
<p>Needless to say, the code wasn&#8217;t done by June 4th. Or June 11th.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
