<?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>Xaprb &#187; Daniel Nichter</title>
	<atom:link href="http://www.xaprb.com/blog/tag/daniel-nichter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xaprb.com/blog</link>
	<description>Stay curious!</description>
	<lastBuildDate>Thu, 09 Feb 2012 10:55:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>mk-query-digest uses less memory</title>
		<link>http://www.xaprb.com/blog/2010/05/19/mk-query-digest-uses-less-memory/</link>
		<comments>http://www.xaprb.com/blog/2010/05/19/mk-query-digest-uses-less-memory/#comments</comments>
		<pubDate>Thu, 20 May 2010 02:29:56 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Maatkit]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Daniel Nichter]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1860</guid>
		<description><![CDATA[Daniel changed mk-query-digest to use much less memory. It parsed and aggregated a 2GB MySQL slow query log file in a few dozen megabytes of memory for me yesterday. Thanks to Facebook for sponsoring this work. Further Reading:mk-query-digest now supports Postgres logs Maatkit&#8217;s mk-query-digest learns about Apdex Learn about mk-query-digest at PgEast 2010 Special mysqldump [...]


<strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2010/02/20/mk-query-digest-now-supports-postgres-logs/' rel='bookmark' title='Permanent Link: mk-query-digest now supports Postgres logs'>mk-query-digest now supports Postgres logs</a></li>
<li><a href='http://www.xaprb.com/blog/2010/11/09/maatkits-mk-query-digest-learns-about-apdex/' rel='bookmark' title='Permanent Link: Maatkit&#8217;s mk-query-digest learns about Apdex'>Maatkit&#8217;s mk-query-digest learns about Apdex</a></li>
<li><a href='http://www.xaprb.com/blog/2010/02/20/learn-about-mk-query-digest-at-pgeast-2010/' rel='bookmark' title='Permanent Link: Learn about mk-query-digest at PgEast 2010'>Learn about mk-query-digest at PgEast 2010</a></li>
<li><a href='http://www.xaprb.com/blog/2011/11/29/special-mysqldump-fingerprinting-rule-in-pt-query-digest/' rel='bookmark' title='Permanent Link: Special mysqldump fingerprinting rule in pt-query-digest'>Special mysqldump fingerprinting rule in pt-query-digest</a></li>
<li><a href='http://www.xaprb.com/blog/2010/03/30/slides-from-my-session-on-mk-query-digest-at-pgeast-2010/' rel='bookmark' title='Permanent Link: Slides from my session on mk-query-digest at PgEast 2010'>Slides from my session on mk-query-digest at PgEast 2010</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Daniel changed <a href="http://www.maatkit.org/">mk-query-digest</a> to use much less memory.  It parsed and aggregated a 2GB MySQL slow query log file in a few dozen megabytes of memory for me yesterday. Thanks to Facebook for sponsoring this work.</p>

<p><strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2010/02/20/mk-query-digest-now-supports-postgres-logs/' rel='bookmark' title='Permanent Link: mk-query-digest now supports Postgres logs'>mk-query-digest now supports Postgres logs</a></li>
<li><a href='http://www.xaprb.com/blog/2010/11/09/maatkits-mk-query-digest-learns-about-apdex/' rel='bookmark' title='Permanent Link: Maatkit&#8217;s mk-query-digest learns about Apdex'>Maatkit&#8217;s mk-query-digest learns about Apdex</a></li>
<li><a href='http://www.xaprb.com/blog/2010/02/20/learn-about-mk-query-digest-at-pgeast-2010/' rel='bookmark' title='Permanent Link: Learn about mk-query-digest at PgEast 2010'>Learn about mk-query-digest at PgEast 2010</a></li>
<li><a href='http://www.xaprb.com/blog/2011/11/29/special-mysqldump-fingerprinting-rule-in-pt-query-digest/' rel='bookmark' title='Permanent Link: Special mysqldump fingerprinting rule in pt-query-digest'>Special mysqldump fingerprinting rule in pt-query-digest</a></li>
<li><a href='http://www.xaprb.com/blog/2010/03/30/slides-from-my-session-on-mk-query-digest-at-pgeast-2010/' rel='bookmark' title='Permanent Link: Slides from my session on mk-query-digest at PgEast 2010'>Slides from my session on mk-query-digest at PgEast 2010</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2010/05/19/mk-query-digest-uses-less-memory/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A script snippet to relative-ize numbers embedded in text</title>
		<link>http://www.xaprb.com/blog/2009/09/01/a-script-snippet-to-relative-ize-numbers-embedded-in-text/</link>
		<comments>http://www.xaprb.com/blog/2009/09/01/a-script-snippet-to-relative-ize-numbers-embedded-in-text/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 00:29:46 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Daniel Nichter]]></category>
		<category><![CDATA[InnoDB]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1269</guid>
		<description><![CDATA[A lot of times I&#8217;m looking at several time-series samples of numbers embedded in free-form text, and I want to know how the numbers change over time. For example, two samples of SHOW INNODB STATUS piped through grep wait might contain the following: Mutex spin waits 0, rounds 143359179688, OS waits 634106844 RW-shared spins 1224152309, [...]


<strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/08/30/a-script-snippet-for-aggregating-gdb-backtraces/' rel='bookmark' title='Permanent Link: A script snippet for aggregating GDB backtraces'>A script snippet for aggregating GDB backtraces</a></li>
<li><a href='http://www.xaprb.com/blog/2006/06/26/how-to-convert-text-to-columns-in-openofficeorg-calc/' rel='bookmark' title='Permanent Link: How to convert text to columns in OpenOffice.org Calc'>How to convert text to columns in OpenOffice.org Calc</a></li>
<li><a href='http://www.xaprb.com/blog/2009/06/05/a-tweak-to-column-alignment-for-the-mext-script/' rel='bookmark' title='Permanent Link: A tweak to column alignment for the mext script'>A tweak to column alignment for the mext script</a></li>
<li><a href='http://www.xaprb.com/blog/2006/01/05/javascript-number-formatting/' rel='bookmark' title='Permanent Link: How to format numbers in JavaScript flexibly and efficiently'>How to format numbers in JavaScript flexibly and efficiently</a></li>
<li><a href='http://www.xaprb.com/blog/2006/03/12/gnucash-to-mysql-export-script/' rel='bookmark' title='Permanent Link: GnuCash to MySQL export script'>GnuCash to MySQL export script</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>A lot of times I&#8217;m looking at several time-series samples of numbers embedded in free-form text, and I want to know how the numbers change over time.  For example, two samples of SHOW INNODB STATUS piped through <code>grep wait</code> might contain the following:</p>

<pre>Mutex spin waits 0, rounds 143359179688, OS waits 634106844
RW-shared spins 1224152309, OS waits 38278807; RW-excl spins 2432166425, OS waits 35264871
Mutex spin waits 0, rounds 143386303439, OS waits 634292093
RW-shared spins 1224197048, OS waits 38281423; RW-excl spins 2432347936, OS waits 35271423</pre>

<p>How much have the numbers changed in the second sample?  My head is too lazy to do that math.  So Daniel Nichter and I whipped up Yet Another Snippet to self-discover patterns of text and numbers, and compare each line against the previous line that matches the same pattern.  Let&#8217;s fetch it:</p>

<code><pre>wget <a href="http://maatkit.googlecode.com/svn/trunk/util/rel">http://maatkit.googlecode.com/svn/trunk/util/rel</a></pre></code>

<p>Now give it the above input, and it&#8217;ll print out something useful (emphasis mine):</p>

<pre>Mutex spin waits 0, rounds 143359179688, OS waits 634106844
RW-shared spins 1224152309, OS waits 38278807; RW-excl spins 2432166425, OS waits 35264871
Mutex spin waits 0, rounds <strong>27123751</strong>, OS waits <strong>185249</strong>
RW-shared spins <strong>44739</strong>, OS waits <strong>2616</strong>; RW-excl spins <strong>181511</strong>, OS waits <strong>6552</strong></pre>

<p>My lazy brain likes that much better.</p>

<p><strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/08/30/a-script-snippet-for-aggregating-gdb-backtraces/' rel='bookmark' title='Permanent Link: A script snippet for aggregating GDB backtraces'>A script snippet for aggregating GDB backtraces</a></li>
<li><a href='http://www.xaprb.com/blog/2006/06/26/how-to-convert-text-to-columns-in-openofficeorg-calc/' rel='bookmark' title='Permanent Link: How to convert text to columns in OpenOffice.org Calc'>How to convert text to columns in OpenOffice.org Calc</a></li>
<li><a href='http://www.xaprb.com/blog/2009/06/05/a-tweak-to-column-alignment-for-the-mext-script/' rel='bookmark' title='Permanent Link: A tweak to column alignment for the mext script'>A tweak to column alignment for the mext script</a></li>
<li><a href='http://www.xaprb.com/blog/2006/01/05/javascript-number-formatting/' rel='bookmark' title='Permanent Link: How to format numbers in JavaScript flexibly and efficiently'>How to format numbers in JavaScript flexibly and efficiently</a></li>
<li><a href='http://www.xaprb.com/blog/2006/03/12/gnucash-to-mysql-export-script/' rel='bookmark' title='Permanent Link: GnuCash to MySQL export script'>GnuCash to MySQL export script</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2009/09/01/a-script-snippet-to-relative-ize-numbers-embedded-in-text/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Maatkit version 2325 released</title>
		<link>http://www.xaprb.com/blog/2008/09/19/maatkit-version-2325-released/</link>
		<comments>http://www.xaprb.com/blog/2008/09/19/maatkit-version-2325-released/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 15:37:43 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Maatkit]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Daniel Nichter]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/2008/09/19/maatkit-version-2325-released/</guid>
		<description><![CDATA[Download Maatkit There&#8217;s a new release with a lot of goodies &#8212; speed, efficiency, user-friendliness, and new features. In particular some of Percona&#8217;s clients have sponsored features for things they need such as the ability to more frequently verify that slaves are in sync with their masters. If you need features, please ask Percona about [...]


<strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/03/31/maatkit-version-3329-released/' rel='bookmark' title='Permanent Link: Maatkit version 3329 released'>Maatkit version 3329 released</a></li>
<li><a href='http://www.xaprb.com/blog/2007/12/16/maatkit-version-1508-released/' rel='bookmark' title='Permanent Link: Maatkit version 1508 released'>Maatkit version 1508 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/03/16/maatkit-version-1877-released/' rel='bookmark' title='Permanent Link: Maatkit version 1877 released'>Maatkit version 1877 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/08/12/maatkit-version-2152-released/' rel='bookmark' title='Permanent Link: Maatkit version 2152 released'>Maatkit version 2152 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/10/18/maatkit-version-2442-released/' rel='bookmark' title='Permanent Link: Maatkit version 2442 released'>Maatkit version 2442 released</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p class="download"><a href="http://code.google.com/p/maatkit/">Download Maatkit</a></p>

<p>There&#8217;s a new release with a lot of goodies &#8212; speed, efficiency, user-friendliness, and new features.  In particular some of <a href="http://www.percona.com/">Percona&#8217;s</a> clients have sponsored features for things they need such as the ability to more frequently verify that slaves are in sync with their masters.  If you need features, please ask Percona about it.</p>

<p><a href="http://hackmysql.com/">Daniel Nichter</a> has written most of the code for this release.  Having a dedicated developer is really moving the project forward.  Thanks Daniel!</p>

<p>If you check the issues list on the project&#8217;s website you&#8217;ll see we have some ambitious plans for the project, mostly driven by real-world needs from Percona&#8217;s clients, many of whom run very large data centers and such.  It makes me really happy that Maatkit is solving serious problems for which no other solution exists.</p>

<p>Here&#8217;s the changelog:</p>

<span id="more-569"></span>

<pre>Changelog for mk-archiver:

2008-09-19: version 1.0.11

   * Updates to shared code.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-audit:

2008-09-19: version 0.9.2

   * Checks /etc/sysctl.conf for default ipv4 system variables (issue 56).
   * No longer reports false-positive duplicate system variables (issue 58).
   * Added --socket.
   * The mysqld binary was not detected correctly from 'ps' output.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-deadlock-logger:

2008-09-19: version 1.0.12

   * Added --pid option.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-duplicate-key-checker:

2008-09-19: version 1.1.8

   * Updates to shared code.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-find:

2008-09-19: version 0.9.13

   * Updates to shared code.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-heartbeat:

2008-09-19: version 1.0.11

   * Dies if heartbeat table does not have at least one row (issue 45).
   * Added --pid option.
   * Using debug (MKDEBUG=1) and --daemonize now causes script to die.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-parallel-dump:

2008-09-19: version 1.0.10

   * Added option --biggestfirst which is enabled by default (issue 31).
   * --noflushlock and --nolocktables caused a global flush and lock (issue 12).
   * Made debugging code more efficient in non-debug mode.
   * Fixed various bugs in shared code.
   * Moved all command-line documentation to POD.

Changelog for mk-parallel-restore:

2008-09-17: version 1.0.9

   * Made restores resume by default if possible (issue 30).
   * Added --noresume option (issue 30).
   * Added --[no]atomicresume option (issue 30).
   * --progress is reported by bytes instead of chunk count (issue 32).
   * --progress counting and prediction was improved.
   * LOAD DATA queries show bytes done and db.tbl name in SQL comment.
   * CHARACTER SET was declared in the wrong place for csv LOAD DATA query.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-query-profiler:

2008-09-19: version 1.1.12

   * Updates to shared code.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-show-grants:

2008-09-19: version 1.0.12

   * Updates to shared code.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-slave-delay:

2008-09-19: version 1.0.9

   * Updates to shared code.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-slave-find:

2008-09-19: version 1.0.3

   * Updates to shared code.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-slave-move:

2008-09-19: version 0.9.3

   * Updates to shared code.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-slave-prefetch:

2008-09-19: version 1.0.4

   * Added --pid option.
   * Using debug (MKDEBUG=1) and --daemonize now causes script to die.
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-slave-restart:

2008-09-19: version 1.0.9

   * Added --pid option (issue 18).
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-table-checksum:

2008-09-19: version 1.1.29

   * Added --argtable, --offset and --modulo for issue 53.
   * Added --nouseindex option (issue 8).
   * Fixed processing of column options (issue 4, patch by Travis Whitton)
   * Changed --emptyrepltbl to always completely empty the table (issue 21).
   * Added --schema option for issue 5.
   * Added --since and --sincecolumn options for issue 53.
   * Added --probability option for issue 53.
   * A missing table caused a crash (issue 35).
   * Functions specified with --function were not optimized (issue 43).
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-table-sync:

2008-09-19: version 1.0.9

   * Added --nouseindex option (issue 8).
   * Dies if any dest table has triggers unless --ignore-triggers (issue 37).
   * Added better support for CRC32 (issue 43).
   * Made debugging code more efficient in non-debug mode.

Changelog for mk-visual-explain:

2008-09-19: version 1.0.10

   * Updates to shared code.
   * Made debugging code more efficient in non-debug mode.</pre>

<p><strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/03/31/maatkit-version-3329-released/' rel='bookmark' title='Permanent Link: Maatkit version 3329 released'>Maatkit version 3329 released</a></li>
<li><a href='http://www.xaprb.com/blog/2007/12/16/maatkit-version-1508-released/' rel='bookmark' title='Permanent Link: Maatkit version 1508 released'>Maatkit version 1508 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/03/16/maatkit-version-1877-released/' rel='bookmark' title='Permanent Link: Maatkit version 1877 released'>Maatkit version 1877 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/08/12/maatkit-version-2152-released/' rel='bookmark' title='Permanent Link: Maatkit version 2152 released'>Maatkit version 2152 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/10/18/maatkit-version-2442-released/' rel='bookmark' title='Permanent Link: Maatkit version 2442 released'>Maatkit version 2442 released</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2008/09/19/maatkit-version-2325-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How Maatkit benefits from test-driven development</title>
		<link>http://www.xaprb.com/blog/2008/08/18/how-maatkit-benefits-from-test-driven-development/</link>
		<comments>http://www.xaprb.com/blog/2008/08/18/how-maatkit-benefits-from-test-driven-development/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 13:54:24 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Maatkit]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[CRC32]]></category>
		<category><![CDATA[Daniel Nichter]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[The Rimm Kaufman Group]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/2008/08/18/how-maatkit-benefits-from-test-driven-development/</guid>
		<description><![CDATA[Over in Maatkit-land, Daniel Nichter and I practice test-first programming, AKA test-driven development. That is, we write tests for each new feature or to catch regressions on each bug we fix. And &#8212; this is crucial &#8212; we write the tests before we write the code.* The tests should initially fail, which is a validation [...]


<strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/05/03/a-productivity-tip-for-test-driven-development/' rel='bookmark' title='Permanent Link: A productivity tip for test-driven development'>A productivity tip for test-driven development</a></li>
<li><a href='http://www.xaprb.com/blog/2008/08/19/how-to-unit-test-code-that-interacts-with-a-database/' rel='bookmark' title='Permanent Link: How to unit-test code that interacts with a database'>How to unit-test code that interacts with a database</a></li>
<li><a href='http://www.xaprb.com/blog/2011/07/06/planned-change-in-maatkit-aspersa-development/' rel='bookmark' title='Permanent Link: Planned change in Maatkit &#038; Aspersa development'>Planned change in Maatkit &#038; Aspersa development</a></li>
<li><a href='http://www.xaprb.com/blog/2007/11/26/four-companies-to-sponsor-maatkit-development/' rel='bookmark' title='Permanent Link: Four companies to sponsor Maatkit development'>Four companies to sponsor Maatkit development</a></li>
<li><a href='http://www.xaprb.com/blog/2007/08/24/google-test-automation-conference-day-1/' rel='bookmark' title='Permanent Link: Google Test Automation Conference, Day 1'>Google Test Automation Conference, Day 1</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Over in <a href="http://www.maatkit.org/">Maatkit</a>-land, <a href="http://hackmysql.com/">Daniel Nichter</a> and I practice <a href="http://en.wikipedia.org/wiki/Test-driven_development">test-first programming, AKA test-driven development</a>.  That is, we write tests for each new feature or to catch regressions on each bug we fix.  And &#8212; this is crucial &#8212; we write the tests <em>before</em> we write the code.*  The tests should initially fail, which is a validation that the new code actually works and the tests actually verify this.  If we don&#8217;t first write a failing testcase, then our code lacks a very important guarantee: &#8220;if you break this code, then the test case will tell you so.&#8221; (A test that doesn&#8217;t fail when the code fails isn&#8217;t worth writing.)</p>

<span id="more-553"></span>

<p>Most of the time when I do this, I write a test, it fails because I haven&#8217;t written any code yet, and I then go do some kind of clean-room coding.  Then I run the test and it&#8217;s busted, and I have to go back to the code and figure out why, and after a few more tries I get it working.  And then it feels great.  (That&#8217;s the other thing about test-first coding.  It&#8217;s really satisfying, like cooking the perfect dinner, arranging the plates beautifully and then eating.)</p>

<p>This time I wanted to write a pure-Perl implementation of CRC32, and embed it in mk-table-checksum.  We try really hard never to rely on external modules, even modules that ought to be distributed with Perl itself.  That keeps Maatkit as portable as possible and makes sure there is no installation hell.  You can generally just get and run the Maatkit tools with no installation.  So I referred to an existing CRC32 implementation, in <a href="http://search.cpan.org/~fays/Digest-Crc32-0.01/Crc32.pm">Digest::Crc32</a>.  I wrote a test by referring to the value I got from MySQL&#8217;s built-in CRC32:</p>

<pre>mysql> select crc32('hello world');
+----------------------+
| crc32('hello world') |
+----------------------+
|            222957957 | 
+----------------------+
1 row in set (0.00 sec)
</pre>

<p>Here&#8217;s the test:</p>

<pre>is($c-&gt;crc32('hello world'), 222957957, 'CRC32 of hello world');</pre>

<p>CRC32 is CRC32, so my code better agree with a working implementation.  And then I wrote the code, which is a refactoring of the math in the module I linked to above.  And then I ran the test, and it Just Passed with no further ado.  w00t!  This is pretty much a historic first for me!  I thought at first that I&#8217;d screwed something up with the test, but I checked again. This is like getting a hole-in-one for me :-)  So I just thought I&#8217;d share it with you.  It feels <strong>awesome</strong>.</p>

<p>If you&#8217;re not doing test-first coding, you ought to give it a try.  If you are conscientious about writing tests first, your code will always be easy to test.  If you don&#8217;t, you write untestable code.  Then it&#8217;s tough or impossible to ever get tests on it, and you spend the rest of your life wasting time on stupid bugs and slow, fearful development, never knowing what else you are breaking with your &#8220;fixes.&#8221;</p>

<p>Test-driven development is one reason <a href="http://www.rimmkaufman.com/">The Rimm-Kaufman Group&#8217;s</a> in-house bidding system blows away their competition.  (RKG is my previous employer.)  The comprehensive unit-test suite lets you know right away if you&#8217;ve broken something.  That keeps the code clean and makes it possible to be extremely productive.  I remember once when one of my co-workers there implemented a major feature in a very short time.  It was also incredibly helpful when sharding the databases (anyone ever done this without a test suite?  Would you like to share about how much of your systems broke during sharding?  It was almost a non-event at RKG).  The people I worked with before I joined RKG looked at me like an alien when I tried to explain that this was possible.</p>

<p>If you&#8217;re thinking that your code is not &#8220;that kind of code,&#8221; that &#8220;only certain kinds of code lend themselves to unit tests,&#8221; then stop. I&#8217;ve heard this before, and you&#8217;re wrong.  It&#8217;s only &#8220;untestable&#8221; because you didn&#8217;t write tests first.  Write tests first, and your code &#8212; all of it! &#8212; will be &#8220;that kind of code&#8221; that is testable.  It&#8217;s hard.  No one says it&#8217;s not; good programming is much harder than sloppy programming.  But it&#8217;s well worth it.</p>

<p>Converting untested, untestable code into tested code is not so much fun, though.  And in my experience you&#8217;ll rarely be rewarded for it, and your coworkers will not appreciate you raising the bar for them.  Maybe you need a new job.  I hear RKG is hiring.  Did I mention that their codebase is built from the ground up on unit tests?</p>

<p>* OK, we&#8217;re not perfectly disciplined about this, but we&#8217;re pretty good about it.</p>

<p><strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/05/03/a-productivity-tip-for-test-driven-development/' rel='bookmark' title='Permanent Link: A productivity tip for test-driven development'>A productivity tip for test-driven development</a></li>
<li><a href='http://www.xaprb.com/blog/2008/08/19/how-to-unit-test-code-that-interacts-with-a-database/' rel='bookmark' title='Permanent Link: How to unit-test code that interacts with a database'>How to unit-test code that interacts with a database</a></li>
<li><a href='http://www.xaprb.com/blog/2011/07/06/planned-change-in-maatkit-aspersa-development/' rel='bookmark' title='Permanent Link: Planned change in Maatkit &#038; Aspersa development'>Planned change in Maatkit &#038; Aspersa development</a></li>
<li><a href='http://www.xaprb.com/blog/2007/11/26/four-companies-to-sponsor-maatkit-development/' rel='bookmark' title='Permanent Link: Four companies to sponsor Maatkit development'>Four companies to sponsor Maatkit development</a></li>
<li><a href='http://www.xaprb.com/blog/2007/08/24/google-test-automation-conference-day-1/' rel='bookmark' title='Permanent Link: Google Test Automation Conference, Day 1'>Google Test Automation Conference, Day 1</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2008/08/18/how-maatkit-benefits-from-test-driven-development/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Maatkit version 2152 released</title>
		<link>http://www.xaprb.com/blog/2008/08/12/maatkit-version-2152-released/</link>
		<comments>http://www.xaprb.com/blog/2008/08/12/maatkit-version-2152-released/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 04:56:59 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Maatkit]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Ask Bjorn Hansen]]></category>
		<category><![CDATA[Daniel Nichter]]></category>
		<category><![CDATA[Google Code]]></category>
		<category><![CDATA[Percona]]></category>
		<category><![CDATA[sourceforge]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/2008/08/12/maatkit-version-2152-released/</guid>
		<description><![CDATA[Download Maatkit Maatkit version 2152 is ready for download. This release is also known as the &#8220;is this project really alive?&#8221; release. We thought we should delay until MySQL released a new Community Server version. Just kidding &#8212; it has nothing to do with that. This release is also very significant in that it&#8217;s the [...]


<strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2008/03/16/maatkit-version-1877-released/' rel='bookmark' title='Permanent Link: Maatkit version 1877 released'>Maatkit version 1877 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/01/24/maatkit-version-1709-released/' rel='bookmark' title='Permanent Link: Maatkit version 1709 released'>Maatkit version 1709 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/09/19/maatkit-version-2325-released/' rel='bookmark' title='Permanent Link: Maatkit version 2325 released'>Maatkit version 2325 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/10/18/maatkit-version-2442-released/' rel='bookmark' title='Permanent Link: Maatkit version 2442 released'>Maatkit version 2442 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/01/05/maatkit-version-1674-released/' rel='bookmark' title='Permanent Link: Maatkit version 1674 released'>Maatkit version 1674 released</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p class="download"><a href="http://code.google.com/p/maatkit/">Download Maatkit</a></p>

<p><a href="http://www.maatkit.org/">Maatkit</a> version 2152 is ready for download.  This release is also known as the &#8220;is this project really alive?&#8221; release.  We thought we should delay until <a href="http://www.mysqlperformanceblog.com/2008/08/08/new-mysql-community-release-great-job-mysql/">MySQL released a new Community Server version</a>.  Just kidding &#8212; it has nothing to do with that.</p>

<span id="more-550"></span>

<p>This release is also very significant in that it&#8217;s the first one that has large code contributions by someone other than myself.  As you may know, <a href="http://www.percona.com/">Percona</a> (my employer) has hired the <a href="http://hackmysql.com/">very talented Daniel Nichter, author of mysqlreport and other goodies</a>, to help with Maatkit.  So far it is a match made in heaven, and Daniel did most of the coding for this release.</p>

<p>This is also our first release since <a href="http://develooper.com/">Ask</a> helped me move the project (thank you Ask!) to Google Code.  That means you finally get a decent interface for entering issues, etc, etc.  The only thing remaining on Sourceforge at this point is the online documentation, which I will probably move to maatkit.org soon.  But more importantly, it means the developers have a decent interface for issues, etc etc.  <a href="http://sourceforge.net/tracker/?func=detail&#038;aid=1855476&#038;group_id=1&#038;atid=350001">Sourceforge is just a bloody nightmare &#8212; their site keeps getting harder and harder to use</a>, both as a developer and as a user.  It had gotten to the point where simply adding the files to the site for download would take me hours.  I tried to automate it, in true Perl fashion, but their make-a-release forms resisted my every effort.  I cannot say what a relief it is to have usable project hosting that gets out of my way and lets me work.  A double thanks to Ask for pushing me over the edge on this &#8212; it had been on my mind a long time.  And thanks to Google, too, for a great project management interface.</p>

<p>Also note that the Sourceforge forums and mailing lists are dead.  Google Groups is the preferred replacement.</p>

<p>Keep reporting those bugs and feature requests!</p>

<p>As you might expect, the changelog for such a long release cycle is, er, large.  There&#8217;s a lot of new stuff here.  I&#8217;d like to highlight the new features in mk-parallel-dump and mk-parallel-restore &#8212; which I just used to reduce a job that would have taken weeks down to mere days &#8212; and a lot of new code in mk-table-sync, as well as the up-and-coming mk-audit, which is in release-early/often mode.</p>

<pre>
Changelog for mk-archiver:

2008-08-11: version 1.0.10

   * Files downloaded directly from SVN crashed due to version information.
   * Added more information to --statistics and changed --whyquit slightly.

Changelog for mk-audit:

2008-08-11: version 0.9.1

   * Files downloaded directly from SVN crashed due to version information.
   * Added useful functionality.

Changelog for mk-deadlock-logger:

2008-08-11: version 1.0.11

   * Files downloaded directly from SVN crashed due to version information.

Changelog for mk-duplicate-key-checker:

2008-08-11: version 1.1.7

   * Files downloaded directly from SVN crashed due to version information.
   * Full-text indexes were not treated specially (issue 10).

Changelog for mk-fifo-split:

2008-08-11: version 1.0.1

   * Files downloaded directly from SVN crashed due to version information.
   * Added --offset option.
   * --statistics didn't calculate lines/sec properly.
   * Removed --sleep; EOF doesn't mean anything to a non-terminal.

Changelog for mk-find:

2008-08-11: version 0.9.12

   * Files downloaded directly from SVN crashed due to version information.
   * Added --exec_dsn so you can execute SQL on a different server.

Changelog for mk-heartbeat:

2008-08-11: version 1.0.10

   * Files downloaded directly from SVN crashed due to version information.

Changelog for mk-parallel-dump:

2008-08-11: version 1.0.9

   * Files downloaded directly from SVN crashed due to version information.
   * Added --progress option.
   * CHANGE MASTER TO in 00_master_data.sql used the I/O thread position.
   * Added features to permit resuming of dumps.
   * --age without --sets did the opposite of what it should (isssue 7)
   * --stopslave died after complaining the slave was not running.

Changelog for mk-parallel-restore:

2008-08-11: version 1.0.8

   * Files downloaded directly from SVN crashed due to version information.
   * Added --progress option.

Changelog for mk-query-profiler:

2008-08-11: version 1.1.11

   * Files downloaded directly from SVN crashed due to version information.

Changelog for mk-show-grants:

2008-08-11: version 1.0.11

   * Files downloaded directly from SVN crashed due to version information.
   * Anonymous users were not permitted (issue 28).

Changelog for mk-slave-delay:

2008-08-11: version 1.0.8

   * Files downloaded directly from SVN crashed due to version information.

Changelog for mk-slave-find:

2008-08-11: version 1.0.2

   * Files downloaded directly from SVN crashed due to version information.

Changelog for mk-slave-move:

2008-08-11: version 0.9.2

   * The -m option was not recognized as an alias for --timeout.
   * Files downloaded directly from SVN crashed due to version information.

Changelog for mk-slave-prefetch:

2008-08-11: version 1.0.3

   * Files downloaded directly from SVN crashed due to version information.
   * Added the --numprefix option for use in sharded data stores.
   * The Rotate binary log event type was not handled.

Changelog for mk-slave-restart:

2008-08-11: version 1.0.8

   * Files downloaded directly from SVN crashed due to version information.

Changelog for mk-table-checksum:

2008-08-11: version 1.1.28

   * Files downloaded directly from SVN crashed due to version information.

Changelog for mk-table-sync:

2008-08-11: version 1.0.8

   * Files downloaded directly from SVN crashed due to version information.
   * --synctomaster did not abort when unable to discover the master.
   * An error waiting for the master to catch up caused other tables to fail.
   * Added --bufferinmysql to help make GroupBy algorithm more efficient.
   * Added safety checks to prevent changing data on a slave server.
   * Added --skipslavecheck to prevent safety checks on destination server.
   * Made the GroupBy algorithm the default replacement for Stream.
   * Added the GroupBy algorithm, which can sync tables without unique keys.
   * Syncing could stop and leave a row to delete in the destination.
   * Generate command-line help from the POD.

Changelog for mk-visual-explain:

2008-08-11: version 1.0.9

   * Files downloaded directly from SVN crashed due to version information.
</pre>

<p><strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2008/03/16/maatkit-version-1877-released/' rel='bookmark' title='Permanent Link: Maatkit version 1877 released'>Maatkit version 1877 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/01/24/maatkit-version-1709-released/' rel='bookmark' title='Permanent Link: Maatkit version 1709 released'>Maatkit version 1709 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/09/19/maatkit-version-2325-released/' rel='bookmark' title='Permanent Link: Maatkit version 2325 released'>Maatkit version 2325 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/10/18/maatkit-version-2442-released/' rel='bookmark' title='Permanent Link: Maatkit version 2442 released'>Maatkit version 2442 released</a></li>
<li><a href='http://www.xaprb.com/blog/2008/01/05/maatkit-version-1674-released/' rel='bookmark' title='Permanent Link: Maatkit version 1674 released'>Maatkit version 1674 released</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2008/08/12/maatkit-version-2152-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

