<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://commons.oreilly.com/wiki/skins/common/feed.css?97"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Put the Mouse Down and Step Away from the Keyboard - Revision history</title>
		<link>http://commons.oreilly.com/wiki/index.php?title=Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.11.0</generator>
		<lastBuildDate>Thu, 23 May 2013 00:14:12 GMT</lastBuildDate>
		<item>
			<title>Kevlin at 10:48, 16 August 2009</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&amp;diff=25296&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 10:48, 16 August 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The same code appeared twice more, with appropriate changes to the character offset and upper limit, to test the minutes and seconds. The method ended with these lines to &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;test &lt;/del&gt;for ''AM'' &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;or &lt;/del&gt;''PM'':&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The same code appeared twice more, with appropriate changes to the character offset and upper limit, to test the minutes and seconds. The method ended with these lines to &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;check &lt;/ins&gt;for ''AM'' &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;and &lt;/ins&gt;''PM'':&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if (!time.substring(9, 11).equals(&amp;quot;AM&amp;quot;) &amp;amp; !time.substring(9, 11).equals(&amp;quot;PM&amp;quot;)) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if (!time.substring(9, 11).equals(&amp;quot;AM&amp;quot;) &amp;amp; !time.substring(9, 11).equals(&amp;quot;PM&amp;quot;)) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;neither &lt;/del&gt;of &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/del&gt;comparisons failed &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;and returned &lt;/del&gt;&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;then &lt;/del&gt;the method returned &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;none of this series &lt;/ins&gt;of comparisons failed&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, returning &lt;/ins&gt;&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;the method returned &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If the preceding code seems wordy and difficult to follow, don't worry. I thought so too &amp;amp;mdash; which meant I'd found something worth cleaning up. I refactored it and wrote a few unit tests, just to make sure it still worked.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If the preceding code seems wordy and difficult to follow, don't worry. I thought so too &amp;amp;mdash; which meant I'd found something worth cleaning up. I refactored it and wrote a few unit tests, just to make sure it still worked.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:25244:newid:25296 --&gt;
&lt;/table&gt;</description>
			<pubDate>Sun, 16 Aug 2009 10:48:50 GMT</pubDate>			<dc:creator>Kevlin</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard</comments>		</item>
		<item>
			<title>BurkHufnagel at 16:47, 10 August 2009</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&amp;diff=25244&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 16:47, 10 August 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So the next time you hit a nasty problem, do yourself a favor. Once you really understand the problem go do something involving the creative side of your brain &amp;amp;mdash; sketch out the problem, listen to some music, or just take a walk outside. Sometimes the best thing you can do to solve a problem is to put the mouse down and step away from the keyboard.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So the next time you hit a nasty problem, do yourself a favor. Once you really understand the problem go do something involving the creative side of your brain &amp;amp;mdash; sketch out the problem, listen to some music, or just take a walk outside. Sometimes the best thing you can do to solve a problem is to put the mouse down and step away from the keyboard.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;P.S. If you're interested in learning more about how your brain works, there's lots of sources available. My current favorite is Andy Hunt's book ''Pragmatic Thinking and Learning''.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By [[BurkHufnagel]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By [[BurkHufnagel]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Mon, 10 Aug 2009 16:47:10 GMT</pubDate>			<dc:creator>BurkHufnagel</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard</comments>		</item>
		<item>
			<title>Kevlin at 13:32, 1 August 2009</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&amp;diff=25068&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:32, 1 August 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The same code appeared twice more, with appropriate changes to the character offset and upper limit, to test the minutes and seconds. The method ended with these lines to test for ''AM'' or ''PM'':&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The same code appeared twice more, with appropriate changes to the character offset and upper limit, to test the minutes and seconds. The method ended with these lines to test for ''AM'' or ''PM'':&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if (!time.substring(9, 11).equals(&amp;quot;AM&amp;quot;) &amp;amp; !time.substring(9, 11).equals(&amp;quot;PM&amp;quot;) ) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if (!time.substring(9, 11).equals(&amp;quot;AM&amp;quot;) &amp;amp; !time.substring(9, 11).equals(&amp;quot;PM&amp;quot;)) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If the preceding code seems wordy and difficult to follow, don't worry. I thought so too &amp;amp;mdash; which meant I'd found something worth cleaning up. I refactored it and wrote a few unit tests, just to make sure it still worked.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If the preceding code seems wordy and difficult to follow, don't worry. I thought so too &amp;amp;mdash; which meant I'd found something worth cleaning up. I refactored it and wrote a few unit tests, just to make sure it still worked.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;When I finished, I felt pleased with the results. The new version was easy to read, half the size, and more accurate because the original code &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;only &lt;/del&gt;tested the upper boundary for the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;hour&lt;/del&gt;, minutes, and seconds.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;When I finished, I felt pleased with the results. The new version was easy to read, half the size, and more accurate because the original code tested &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;only &lt;/ins&gt;the upper boundary for the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;hours&lt;/ins&gt;, minutes, and seconds.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;While getting ready for work the next day, an idea popped in my head&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;; why &lt;/del&gt;not validate the string using a regular expression? After a few minutes typing, I had a working implementation in just one line of code. Here it is:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;While getting ready for work the next day, an idea popped in my head&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;: Why &lt;/ins&gt;not validate the string using a regular expression? After a few minutes typing, I had a working implementation in just one line of code. Here it is:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; public static boolean validateTime(String time) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; public static boolean validateTime(String time) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return time.matches( &amp;quot;(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] ([AP]M)&amp;quot; );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return time.matches(&amp;quot;(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] ([AP]M)&amp;quot;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The point of this story is not that I eventually replaced over thirty lines of code with just one. The point is that until I got away from the computer, I thought my first attempt was the best solution to the problem.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The point of this story is not that I eventually replaced over thirty lines of code with just one. The point is that until I got away from the computer, I thought my first attempt was the best solution to the problem.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So the next time you hit a nasty problem, do yourself a favor. Once you really understand the problem go do something involving the creative side of your brain; sketch out the problem, listen to some music, or just take a walk outside. Sometimes the best thing you can do to solve a problem is to put the mouse down and step away from the keyboard.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So the next time you hit a nasty problem, do yourself a favor. Once you really understand the problem go do something involving the creative side of your brain &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash&lt;/ins&gt;; sketch out the problem, listen to some music, or just take a walk outside. Sometimes the best thing you can do to solve a problem is to put the mouse down and step away from the keyboard.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;P.S. If you're interested in learning more about how your brain works, there's lots of sources available. My current favorite is Andy Hunt's book ''Pragmatic Thinking and Learning''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;P.S. If you're interested in learning more about how your brain works, there's lots of sources available. My current favorite is Andy Hunt's book ''Pragmatic Thinking and Learning''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 01 Aug 2009 13:32:26 GMT</pubDate>			<dc:creator>Kevlin</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard</comments>		</item>
		<item>
			<title>Kevlin: Put the mouse down and step away from the keyboard moved to Put the Mouse Down and Step Away from the Keyboard</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&amp;diff=25063&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;a href=&quot;/wiki/index.php/Put_the_mouse_down_and_step_away_from_the_keyboard&quot; title=&quot;Put the mouse down and step away from the keyboard&quot;&gt;Put the mouse down and step away from the keyboard&lt;/a&gt; moved to &lt;a href=&quot;/wiki/index.php/Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&quot; title=&quot;Put the Mouse Down and Step Away from the Keyboard&quot;&gt;Put the Mouse Down and Step Away from the Keyboard&lt;/a&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:28, 1 August 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/table&gt;</description>
			<pubDate>Sat, 01 Aug 2009 13:28:10 GMT</pubDate>			<dc:creator>Kevlin</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard</comments>		</item>
		<item>
			<title>Kevlin at 21:28, 31 July 2009</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&amp;diff=25059&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 21:28, 31 July 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;You’ve &lt;/del&gt;been focused for hours on some gnarly problem and there's no solution in sight. So you get up to stretch your legs, or to hit the vending machines, and on the way back the answer suddenly becomes obvious. &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;You've &lt;/ins&gt;been focused for hours on some gnarly problem and there's no solution in sight. So you get up to stretch your legs, or to hit the vending machines, and on the way back the answer suddenly becomes obvious.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Does this scenario sound familiar? Ever wonder why it happens? The trick is that while &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you’re &lt;/del&gt;coding, the logical part of your brain is active and the creative side is shut out. It &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;can’t &lt;/del&gt;present anything to you until the logical side takes a break.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Does this scenario sound familiar? Ever wonder why it happens? The trick is that while &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you're &lt;/ins&gt;coding, the logical part of your brain is active and the creative side is shut out. It &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;can't &lt;/ins&gt;present anything to you until the logical side takes a break.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Here’s &lt;/del&gt;a real-life example: I was cleaning up some legacy code and ran into an &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“interesting” &lt;/del&gt;method. It was designed to verify that a string contained a valid time using the format &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“hh&lt;/del&gt;:mm:ss &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;xx”&lt;/del&gt;, where &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;‘hh’ &lt;/del&gt;represents the hour, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;‘mm’ &lt;/del&gt;represents minutes, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;‘ss’ &lt;/del&gt;represents seconds, and &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;‘xx’ &lt;/del&gt;is either &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;‘AM’ &lt;/del&gt;or &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;‘PM’&lt;/del&gt;. &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Here's &lt;/ins&gt;a real-life example: I was cleaning up some legacy code and ran into an &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'interesting' &lt;/ins&gt;method. It was designed to verify that a string contained a valid time using the format &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''hh&lt;/ins&gt;:mm:ss &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;xx''&lt;/ins&gt;, where &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''hh'' &lt;/ins&gt;represents the hour, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''mm'' &lt;/ins&gt;represents minutes, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''ss'' &lt;/ins&gt;represents seconds, and &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''xx'' &lt;/ins&gt;is either &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''AM'' &lt;/ins&gt;or &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''PM''&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The method used the following code to convert two characters (representing the hour) into a number, and verify it was within the proper range:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The method used the following code to convert two characters (representing the hour) into a number, and verify it was within the proper range:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; try {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; try {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     Integer.parseInt( time.substring(0, 2) );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     Integer.parseInt(time.substring(0, 2));&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; } catch ( Exception x ) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; } catch (Exception x) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if ( Integer.parseInt(time.substring(0, 2) ) &amp;gt; 12) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if (Integer.parseInt(time.substring(0, 2)) &amp;gt; 12) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The same code appeared twice more, with appropriate changes to the character offset and upper limit, to test the minutes and seconds. The method ended with these lines to test for &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;‘AM’ &lt;/del&gt;or &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;‘PM’&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The same code appeared twice more, with appropriate changes to the character offset and upper limit, to test the minutes and seconds. The method ended with these lines to test for &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''AM'' &lt;/ins&gt;or &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''PM''&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if ( !time.substring(9, 11).equals(&amp;quot;AM&amp;quot;) &amp;amp; !time.substring(9, 11).equals(&amp;quot;PM&amp;quot;) ) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if (!time.substring(9, 11).equals(&amp;quot;AM&amp;quot;) &amp;amp; !time.substring(9, 11).equals(&amp;quot;PM&amp;quot;) ) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;none &lt;/del&gt;of the comparisons failed and returned &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“false” &lt;/del&gt;then the method returned &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“true”&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;neither &lt;/ins&gt;of the comparisons failed and returned &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; &lt;/ins&gt;then the method returned &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If the preceding code seems wordy and difficult to follow, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;don’t &lt;/del&gt;worry. I thought so too; which meant &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;I’d &lt;/del&gt;found something worth cleaning up. I refactored it and wrote a few unit tests &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;- &lt;/del&gt;just to make sure it still worked.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If the preceding code seems wordy and difficult to follow, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;don't &lt;/ins&gt;worry. I thought so too &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash&lt;/ins&gt;; which meant &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;I'd &lt;/ins&gt;found something worth cleaning up. I refactored it and wrote a few unit tests&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;just to make sure it still worked.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;When I finished, I felt pleased with the results. The new version was easy to read, half the size, and more accurate because the original code only tested the upper boundary for the hour, minutes, and seconds.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;When I finished, I felt pleased with the results. The new version was easy to read, half the size, and more accurate because the original code only tested the upper boundary for the hour, minutes, and seconds.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;While getting ready for work the next day, an idea popped in my head; why not validate the string using a regular expression? After a few minutes typing, I had a working implementation in just one line of code. Here it is:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;While getting ready for work the next day, an idea popped in my head; why not validate the string using a regular expression? After a few minutes typing, I had a working implementation in just one line of code. Here it is:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; public static boolean validateTime( String time ) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; public static boolean validateTime(String time) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return time.matches( &amp;quot;(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] ([AP]M)&amp;quot; );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return time.matches( &amp;quot;(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] ([AP]M)&amp;quot; );&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So the next time you hit a nasty problem, do yourself a favor. Once you really understand the problem go do something involving the creative side of your brain; sketch out the problem, listen to some music, or just take a walk outside. Sometimes the best thing you can do to solve a problem is to put the mouse down and step away from the keyboard.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So the next time you hit a nasty problem, do yourself a favor. Once you really understand the problem go do something involving the creative side of your brain; sketch out the problem, listen to some music, or just take a walk outside. Sometimes the best thing you can do to solve a problem is to put the mouse down and step away from the keyboard.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;P.S. If &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you’re &lt;/del&gt;interested in learning more about how your brain works, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;there’s &lt;/del&gt;lots of sources available. My current favorite is Andy &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Hunt’s &lt;/del&gt;book &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“Pragmatic &lt;/del&gt;Thinking and &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Learning”&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;P.S. If &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you're &lt;/ins&gt;interested in learning more about how your brain works, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;there's &lt;/ins&gt;lots of sources available. My current favorite is Andy &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Hunt's &lt;/ins&gt;book &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''Pragmatic &lt;/ins&gt;Thinking and &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Learning''&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By [[BurkHufnagel]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By [[BurkHufnagel]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Fri, 31 Jul 2009 21:28:55 GMT</pubDate>			<dc:creator>Kevlin</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard</comments>		</item>
		<item>
			<title>BurkHufnagel at 12:38, 2 July 2009</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&amp;diff=24561&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 12:38, 2 July 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;I was cleaning up some legacy code and ran into an &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;interesting &lt;/del&gt;method. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;It was designed to verify that a string contained a valid time using the format “hh:mm:ss xx”, where ‘hh’ represents the hour, ‘mm’ represents minutes, ‘ss’ represents seconds, and ‘xx’ is either ‘AM’ or ‘PM’. &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;You’ve been focused for hours on some gnarly problem and there's no solution in sight. So you get up to stretch your legs, or to hit the vending machines, and on the way back the answer suddenly becomes obvious. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Does this scenario sound familiar? Ever wonder why it happens? The trick is that while you’re coding, the logical part of your brain is active and the creative side is shut out. It can’t present anything to you until the logical side takes a break.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Here’s a real-life example: &lt;/ins&gt;I was cleaning up some legacy code and ran into an &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;“interesting” &lt;/ins&gt;method. It was designed to verify that a string contained a valid time using the format “hh:mm:ss xx”, where ‘hh’ represents the hour, ‘mm’ represents minutes, ‘ss’ represents seconds, and ‘xx’ is either ‘AM’ or ‘PM’. &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The method used the following code to convert two characters (representing the hour) into a number, and verify it was within the proper range:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The method used the following code to convert two characters (representing the hour) into a number, and verify it was within the proper range:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The point of this story is not that I eventually replaced over thirty lines of code with just one. The point is that until I got away from the computer, I thought my first attempt was the best solution to the problem.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The point of this story is not that I eventually replaced over thirty lines of code with just one. The point is that until I got away from the computer, I thought my first attempt was the best solution to the problem.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;If you’re an experienced programmer, my story may sound familiar. It often goes like this: You’ve been focused for hours on some gnarly problem and there's no solution in sight. &lt;/del&gt;So you &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;get up to stretch your legs, or to &lt;/del&gt;hit &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the vending machines&lt;/del&gt;, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;and on &lt;/del&gt;the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;way back &lt;/del&gt;the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;answer suddenly becomes obvious.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the next time &lt;/ins&gt;you hit &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;a nasty problem&lt;/ins&gt;, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;do yourself a favor. Once you really understand &lt;/ins&gt;the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;problem go do something involving &lt;/ins&gt;the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;creative side &lt;/ins&gt;of your brain&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;; sketch out &lt;/ins&gt;the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;problem, listen to some music, or just take a walk outside&lt;/ins&gt;. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Sometimes the best thing &lt;/ins&gt;you &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;can do to solve &lt;/ins&gt;a &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;problem is to &lt;/ins&gt;put the mouse down and step away from the keyboard.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;The trick is that while you’re coding, the logical part &lt;/del&gt;of your brain &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;is active and &lt;/del&gt;the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;creative side is shut out&lt;/del&gt;. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;It can’t present anything to &lt;/del&gt;you &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;until the logical side takes &lt;/del&gt;a &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;break. So &lt;/del&gt;put the mouse down&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/del&gt;and step away from the keyboard&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;. The insights you gain may surprise you&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;P.S. If you’re interested in learning more about how your brain works, there’s lots of sources available. My current favorite is Andy Hunt’s book “Pragmatic Thinking and Learning”.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;P.S. If you’re interested in learning more about how your brain works, there’s lots of sources available. My current favorite is Andy Hunt’s book “Pragmatic Thinking and Learning”.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:23676:newid:24561 --&gt;
&lt;/table&gt;</description>
			<pubDate>Thu, 02 Jul 2009 12:38:53 GMT</pubDate>			<dc:creator>BurkHufnagel</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard</comments>		</item>
		<item>
			<title>BurkHufnagel at 03:20, 13 March 2009</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&amp;diff=23676&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 03:20, 13 March 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;While &lt;/del&gt;cleaning up some legacy code&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, I found a &lt;/del&gt;method designed to verify that a &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;formatted &lt;/del&gt;string contained a valid time&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;. The expected &lt;/del&gt;format &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;was &lt;/del&gt;“hh:mm:ss xx”, where ‘hh’ represents the hour, ‘mm’ represents minutes, ‘ss’ represents seconds, and ‘xx’ is either ‘AM’ or ‘PM’&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;. It seemed fairly long so I took a closer look&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;I was &lt;/ins&gt;cleaning up some legacy code &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;and ran into an interesting &lt;/ins&gt;method&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;.  It was &lt;/ins&gt;designed to verify that a string contained a valid time &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;using the &lt;/ins&gt;format “hh:mm:ss xx”, where ‘hh’ represents the hour, ‘mm’ represents minutes, ‘ss’ represents seconds, and ‘xx’ is either ‘AM’ or ‘PM’. &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The method used the following code to convert two characters (representing the hour) into a number, and verify &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;that &lt;/del&gt;it was within the proper range:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The method used the following code to convert two characters (representing the hour) into a number, and verify it was within the proper range:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; try {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; try {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     Integer.parseInt( time.substring(0, 2) );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     Integer.parseInt( time.substring(0, 2) );&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The same &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;basic &lt;/del&gt;code appeared twice more, with appropriate changes to the character offset and upper limit, to test the minutes and seconds. The method ended with these lines to test for ‘AM’ or ‘PM’:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The same code appeared twice more, with appropriate changes to the character offset and upper limit, to test the minutes and seconds. The method ended with these lines to test for ‘AM’ or ‘PM’:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if ( !time.substring(9, 11).equals(&amp;quot;AM&amp;quot;) &amp;amp; !time.substring(9, 11).equals(&amp;quot;PM&amp;quot;) ) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if ( !time.substring(9, 11).equals(&amp;quot;AM&amp;quot;) &amp;amp; !time.substring(9, 11).equals(&amp;quot;PM&amp;quot;) ) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If none of the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;previous code found a problem &lt;/del&gt;and returned “false” then the method returned “true”.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If none of the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;comparisons failed &lt;/ins&gt;and returned “false” then the method returned “true”.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If the preceding code seems wordy and difficult to follow, don’t worry. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Even an experienced Java developer might think the same&lt;/del&gt;; which meant I’d found something worth cleaning up. I refactored it and wrote a few unit tests - just to make sure it still worked.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If the preceding code seems wordy and difficult to follow, don’t worry. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;I thought so too&lt;/ins&gt;; which meant I’d found something worth cleaning up. I refactored it and wrote a few unit tests - just to make sure it still worked.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;I felt pleased with the results. The new version was &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;easier &lt;/del&gt;to read, half the size, and more accurate because the original code &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;had &lt;/del&gt;only tested the upper boundary for the hour, minutes, and seconds.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;When I finished, &lt;/ins&gt;I felt pleased with the results. The new version was &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;easy &lt;/ins&gt;to read, half the size, and more accurate because the original code only tested the upper boundary for the hour, minutes, and seconds.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;While getting ready for work the next day, an idea popped in my head; why not &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;use &lt;/del&gt;a regular expression &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;to validate the string&lt;/del&gt;? After a few minutes typing, I had a &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;new &lt;/del&gt;implementation &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;that only needed &lt;/del&gt;one line of code&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;. It worked, but it felt too complicated so I split it in two to make it more readable&lt;/del&gt;. Here it is:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;While getting ready for work the next day, an idea popped in my head; why not &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;validate the string using &lt;/ins&gt;a regular expression? After a few minutes typing, I had a &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;working &lt;/ins&gt;implementation &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;in just &lt;/ins&gt;one line of code. Here it is:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; public static boolean validateTime( String time ) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; public static boolean validateTime( String time ) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;String REGEX_PATTERN = &lt;/del&gt;&amp;quot;(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] ([AP]M)&amp;quot;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;return time.matches( &lt;/ins&gt;&amp;quot;(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] ([AP]M)&amp;quot; );&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;     return time.matches( REGEX_PATTERN &lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The point of this story is not that I eventually replaced over thirty lines of code with just &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;two&lt;/del&gt;. The point is that until I got away from the computer, I thought my first attempt was the best solution to the problem.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The point of this story is not that I eventually replaced over thirty lines of code with just &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;one&lt;/ins&gt;. The point is that until I got away from the computer, I thought my first attempt was the best solution to the problem.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you’re an experienced programmer, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;this scenario &lt;/del&gt;may sound familiar. It often goes like this: You’ve been focused for hours on some gnarly problem and there's no solution in sight. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;You &lt;/del&gt;get up to stretch your legs, or to hit the vending machines, and on the way back the answer suddenly becomes obvious.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you’re an experienced programmer, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;my story &lt;/ins&gt;may sound familiar. It often goes like this: You’ve been focused for hours on some gnarly problem and there's no solution in sight. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;So you &lt;/ins&gt;get up to stretch your legs, or to hit the vending machines, and on the way back the answer suddenly becomes obvious.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The trick is that while you’re coding, the logical part of your brain is active and the creative side is shut out. It can’t present anything to you until the logical side takes a break. So put the mouse down, and step away from the keyboard. The insights you gain may surprise you.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The trick is that while you’re coding, the logical part of your brain is active and the creative side is shut out. It can’t present anything to you until the logical side takes a break. So put the mouse down, and step away from the keyboard. The insights you gain may surprise you.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;P.S. If you’re interested in learning more about how your brain works, there’s lots of sources available. My current favorite is Andy Hunt’s book “Pragmatic Thinking and Learning”.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By [[BurkHufnagel]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By [[BurkHufnagel]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:23619:newid:23676 --&gt;
&lt;/table&gt;</description>
			<pubDate>Fri, 13 Mar 2009 03:20:30 GMT</pubDate>			<dc:creator>BurkHufnagel</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard</comments>		</item>
		<item>
			<title>BurkHufnagel at 03:04, 7 March 2009</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&amp;diff=23619&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 03:04, 7 March 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If the preceding code seems wordy and difficult to follow, don’t worry. Even an experienced Java developer might think the same; which meant I’d found something worth cleaning up. I refactored it and wrote a few unit tests - just to make sure it still worked.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If the preceding code seems wordy and difficult to follow, don’t worry. Even an experienced Java developer might think the same; which meant I’d found something worth cleaning up. I refactored it and wrote a few unit tests - just to make sure it still worked.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;I felt pleased with the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;rsults&lt;/del&gt;. The new version was easier to read, half the size, and more accurate because the original code had only tested the upper &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;bounds &lt;/del&gt;for the hour, minutes, and seconds&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;. Not bad for half an hour’s work&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;I felt pleased with the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;results&lt;/ins&gt;. The new version was easier to read, half the size, and more accurate because the original code had only tested the upper &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;boundary &lt;/ins&gt;for the hour, minutes, and seconds.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;While getting ready for work the next day, an idea popped in my head; use a regular expression to validate the string&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;. &lt;/del&gt;After a few minutes typing, I had a new implementation that only needed one line of code. It worked, but it felt too complicated so I split it in two to make it more readable. Here it is:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;While getting ready for work the next day, an idea popped in my head; &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;why not &lt;/ins&gt;use a regular expression to validate the string&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;? &lt;/ins&gt;After a few minutes typing, I had a new implementation that only needed one line of code. It worked, but it felt too complicated so I split it in two to make it more readable. Here it is:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; public static boolean validateTime( String time ) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; public static boolean validateTime( String time ) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     String REGEX_PATTERN = &amp;quot;(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] ([AP]M)&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     String REGEX_PATTERN = &amp;quot;(0[1-9]|1[0-2]):[0-5][0-9]:[0-5][0-9] ([AP]M)&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The point of this story is not that I eventually &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;wrote two &lt;/del&gt;lines of code &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;that did what the original didn’t quite accomplish &lt;/del&gt;with &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;over thirty&lt;/del&gt;. The point is that until I got away from the computer, I thought my first attempt was the best solution to the problem.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The point of this story is not that I eventually &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;replaced over thirty &lt;/ins&gt;lines of code with &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;just two&lt;/ins&gt;. The point is that until I got away from the computer, I thought my first attempt was the best solution to the problem.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you’re an experienced programmer, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you’ve probably had similar experiences&lt;/del&gt;. It often goes like this: You’ve been focused for hours on some gnarly problem and there's no solution in sight. You get up &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;for a bio-break&lt;/del&gt;, or to hit the vending machines, and on the way back the answer suddenly becomes obvious.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you’re an experienced programmer, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;this scenario may sound familiar&lt;/ins&gt;. It often goes like this: You’ve been focused for hours on some gnarly problem and there's no solution in sight. You get up &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;to stretch your legs&lt;/ins&gt;, or to hit the vending machines, and on the way back the answer suddenly becomes obvious.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The trick is that while you’re coding, the logical part of your brain is active and the creative side is shut out. It can’t present anything to you until the logical side takes a break. So put the mouse down and step away from the keyboard. The insights you gain may surprise you.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The trick is that while you’re coding, the logical part of your brain is active and the creative side is shut out. It can’t present anything to you until the logical side takes a break. So put the mouse down&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;and step away from the keyboard. The insights you gain may surprise you.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By [[BurkHufnagel]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By [[BurkHufnagel]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 07 Mar 2009 03:04:03 GMT</pubDate>			<dc:creator>BurkHufnagel</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard</comments>		</item>
		<item>
			<title>BurkHufnagel at 02:49, 7 March 2009</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&amp;diff=23618&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 02:49, 7 March 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;While cleaning up some legacy code, I found a method designed to verify that a formatted string contained a valid time. The expected format was “hh:mm:ss xx”, where ‘hh’ represents the hour, ‘mm’ represents minutes, ‘ss’ represents seconds, and ‘xx’ is either ‘AM’ or ‘PM’. It seemed fairly long so I took a closer look.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;While cleaning up some legacy code, I found a method designed to verify that a formatted string contained a valid time. The expected format was “hh:mm:ss xx”, where ‘hh’ represents the hour, ‘mm’ represents minutes, ‘ss’ represents seconds, and ‘xx’ is either ‘AM’ or ‘PM’. It seemed fairly long so I took a closer look.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The method used the following code to convert two characters (representing the hour) into a number, and verify that it was &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;in &lt;/del&gt;the proper range:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The method used the following code to convert two characters (representing the hour) into a number, and verify that it was &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;within &lt;/ins&gt;the proper range:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; try {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; try {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     Integer.parseInt( time.substring(0, 2) );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     Integer.parseInt( time.substring(0, 2) );&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if ( Integer.parseInt(time.substring(0, 2) ) &amp;gt; 12) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; if ( Integer.parseInt(time.substring(0, 2) ) &amp;gt; 12) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;     return false;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 07 Mar 2009 02:49:04 GMT</pubDate>			<dc:creator>BurkHufnagel</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard</comments>		</item>
		<item>
			<title>BurkHufnagel at 02:47, 7 March 2009</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard&amp;diff=23617&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 02:47, 7 March 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The point of this story is not that I eventually wrote &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;one line &lt;/del&gt;of code that did what the original didn’t quite accomplish with over thirty. The point is that until I got away from the computer, I thought my first attempt was the best solution to the problem.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The point of this story is not that I eventually wrote &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;two lines &lt;/ins&gt;of code that did what the original didn’t quite accomplish with over thirty. The point is that until I got away from the computer, I thought my first attempt was the best solution to the problem.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you’re an experienced programmer, you’ve probably had similar experiences. It often goes like this: You’ve been focused for hours on some gnarly problem and there's no solution in sight. You get up for a bio-break, or to hit the vending machines, and on the way back the answer suddenly becomes obvious.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you’re an experienced programmer, you’ve probably had similar experiences. It often goes like this: You’ve been focused for hours on some gnarly problem and there's no solution in sight. You get up for a bio-break, or to hit the vending machines, and on the way back the answer suddenly becomes obvious.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 07 Mar 2009 02:47:00 GMT</pubDate>			<dc:creator>BurkHufnagel</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:Put_the_Mouse_Down_and_Step_Away_from_the_Keyboard</comments>		</item>
	</channel>
</rss>