<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><language>en-us</language><copyright>Copyright 2006</copyright><managingEditor>palrich@gmail.com</managingEditor><webMaster>palrich@gmail.com</webMaster><lastBuildDate>Sat, 19 May 2012 17:50:41 +0000</lastBuildDate><pubDate>Sat, 19 May 2012 17:50:41 +0000</pubDate><ttl>60</ttl><generator>WeirdLooking.com</generator><link>http://www.weirdlooking.com/</link><description>WeirdLooking.com: Michael Barton's Blog</description><title>WeirdLooking.com: Michael Barton's Blog</title><image><url>http://www.weirdlooking.com/images/feed.png</url><title>WeirdLooking.com: Michael Barton's Blog</title><link>http://www.weirdlooking.com/</link></image><item><title>interrupts in python io</title><dc:creator>Michael Barton</dc:creator><link>http://www.weirdlooking.com/blog/interrupts-in-python-io</link><guid>http://www.weirdlooking.com/blog/interrupts-in-python-io</guid><pubDate>Mon, 09 Mar 2009 12:55:55 +0000</pubDate><description>Graham Dumpleton just wrote a &lt;a href=&quot;http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fblog.dscpl.com.au%2F2009%2F03%2Fload-spikes-and-excessive-memory-usage.html) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;blog post&lt;/a&gt; recommending mod_wsgi&amp;rsquo;s daemon mode, I guess on the grounds that it&amp;rsquo;s harder to screw up than apache&amp;rsquo;s mpm configurations.&amp;nbsp; All the talk of mpms reminded me that I&amp;rsquo;d never posted anything about this one problem I had a while back.&lt;br /&gt;&lt;br /&gt;See, apache&amp;rsquo;s &lt;a href=&quot;http://httpd.apache.org/docs/2.0/mod/worker.html&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fhttpd.apache.org%2Fdocs%2F2.0%2Fmod%2Fworker.html) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;worker mpm&lt;/a&gt; looks pretty appealing when you&amp;rsquo;re trying to squeeze a little more performance out of a mod_python or mod_wsgi app.&amp;nbsp; Serving requests in individual threads running on the same Python interpreter should reduce the overall memory footprint and would let you keep expensive resources like persistent database connections in a per-interpreter pool that threads access as needed.&amp;nbsp; SQLAlchemy&amp;rsquo;s queue pool is threadsafe for exactly that sort of application.&lt;br /&gt;&lt;br /&gt;But there&amp;rsquo;s a snag if you use any networked services:&amp;nbsp; Apache children get signaled when they hit MaxRequestsPerChild (with SIGUSR2 or SIGRTMIN or something along those lines), and maybe on some other events &amp;#8211; that&amp;rsquo;s just the one I could readily reproduce.&amp;nbsp; If any of the child&amp;rsquo;s threads are in blocking system calls (i.e. network i/o) when that signal hits, the call will be interrupted and a Python exception raised.&lt;br /&gt;&lt;br /&gt;In real life you have to write networking code so that it can treat interrupts as non-fatal errors, but Python&amp;rsquo;s standard library makes that difficult.&amp;nbsp; The popular sendall and readline methods on sockets can&amp;rsquo;t be used period, since they&amp;rsquo;ll lose important state if they&amp;rsquo;re interrupted.&amp;nbsp; Most libraries that use the network, including anything built on top of httplib (such as the clients from xmlrpclib, zsi, suds, etc.), fail to treat interrupts as non-fatal errors.&amp;nbsp; Fortunately, the database libraries I&amp;rsquo;ve looked at have more robust networking.&lt;br /&gt;&lt;br /&gt;In some cases, you could wrap an entire high-level request in a try/except, check if the error argument is EINTR (or EWOULDBLOCK due to a bug in Python &amp;lt; 2.5), then re-try the whole request.&amp;nbsp; But that&amp;rsquo;s expensive, and if you happened to be streaming transient data to a remote server or something, you&amp;rsquo;re screwed.&lt;br /&gt;&lt;br /&gt;I&amp;rsquo;ve had some success monkey patching the socket object with methods that re-try on interrupt, but the socket module&amp;rsquo;s layout makes that difficult, fragile and slow.&amp;nbsp; I also tried writing a module that re-registered all signal handlers for the process with the SA_RESTART set, but that caused more problems than it solved (and some system calls can&amp;rsquo;t be restarted anyway).&amp;nbsp; We&amp;rsquo;ve considered patching the socket library to re-try i/o on interrupt at the C level, but the administrative overhead of maintaining a forked Python just isn&amp;rsquo;t worth it.&lt;br /&gt;&lt;br /&gt;So it looks like pre-fork mpm is the only workable choice for mod_python if you use any networked services.&amp;nbsp; Maybe mod_wsgi in daemon mode would insulate the Python interpreter from any signals, but honestly it&amp;rsquo;s pretty unlikely that our app will be ported any time soon.</description><category>programming</category><category>python</category><comments>http://www.weirdlooking.com/blog/interrupts-in-python-io#comments</comments><wfw:comment>http://www.weirdlooking.com/comments/110</wfw:comment><wfw:commentRss>http://www.weirdlooking.com/rss/comments/110</wfw:commentRss><slash:comments>0</slash:comments></item><item><title>sign's new home</title><dc:creator>Michael Barton</dc:creator><link>http://www.weirdlooking.com/blog/signs-new-home</link><guid>http://www.weirdlooking.com/blog/signs-new-home</guid><pubDate>Sat, 25 Oct 2008 08:09:53 +0000</pubDate><description>&lt;div class=&quot;flickr-frame&quot;&gt;	&lt;a href=&quot;http://www.flickr.com/photos/24388430@N08/2970491633/&quot; title=&quot;photo sharing&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3174/2970491633_05ac2d6d59.jpg&quot; class=&quot;flickr-photo&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class=&quot;flickr-caption&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/24388430@N08/2970491633/&quot;&gt;sign's new home&lt;/a&gt;, originally uploaded by &lt;a href=&quot;http://www.flickr.com/people/24388430@N08/&quot;&gt;red_bo&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;				&lt;p class=&quot;flickr-yourcomment&quot;&gt;	The favotech sign is now mounted in our living room, where it shares&lt;br /&gt;news headlines, stock quotes and weather forecasts scraped from the&lt;br /&gt;web.  It's a very depressing sign.&lt;br /&gt;&lt;br /&gt;I ordered a Pro-Lite sign to play around with at work, but it won't&lt;br /&gt;get here until next week.&lt;/p&gt;</description><comments>http://www.weirdlooking.com/blog/signs-new-home#comments</comments><wfw:comment>http://www.weirdlooking.com/comments/109</wfw:comment><wfw:commentRss>http://www.weirdlooking.com/rss/comments/109</wfw:commentRss><slash:comments>2</slash:comments></item><item><title>some sign code</title><dc:creator>Michael Barton</dc:creator><link>http://www.weirdlooking.com/blog/some-sign-code</link><guid>http://www.weirdlooking.com/blog/some-sign-code</guid><pubDate>Fri, 03 Oct 2008 16:54:44 +0000</pubDate><description>So, what I&amp;rsquo;ve got &lt;a href=&quot;http://www.weirdlooking.com/blog/108/protocol.py&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.weirdlooking.com%2Fblog%2F108%2Fprotocol.py) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;here&lt;/a&gt; is my implementation of the favotech sign&amp;rsquo;s protocol in python.&amp;nbsp; As I&amp;rsquo;ve mentioned, it&amp;rsquo;s horrible.&amp;nbsp; From what I can tell, the sign supports basically the same protocol over TCP, UDP, and serial.&amp;nbsp; I&amp;rsquo;ve been using UDP over a &lt;a href=&quot;http://www.flickr.com/photos/24388430@N08/2909395961/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.flickr.com%2Fphotos%2F24388430%40N08%2F2909395961%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;crossover cable&lt;/a&gt; from a whitebox with two NICs, and that&amp;rsquo;s worked fine.&lt;br /&gt;&lt;br /&gt;I&amp;rsquo;m using it inside a &lt;a href=&quot;http://twistedmatrix.com/trac/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Ftwistedmatrix.com%2Ftrac%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;twisted&lt;/a&gt; app, mostly for all the batteries it includes.&amp;nbsp; I have a UDP server class that inherits from this class, but implements its own send_to_sign method.&amp;nbsp; This layout made reusing the code for different connection media a breeze.&amp;nbsp; Basic usage then looks something like this:&lt;br /&gt;&lt;br /&gt;&lt;code style=&quot;display: block;&quot; class=&quot;blockocode&quot;&gt; &amp;nbsp; self.test_reset()&lt;br/&gt; &amp;nbsp; self.pause()&lt;br/&gt; &amp;nbsp; self.time_sync()&lt;br/&gt; &amp;nbsp; self.set_frame_count(&lt;span style=&quot;color: #FF0000&quot;&gt;3&lt;/span&gt;)&lt;br/&gt; &amp;nbsp; self.set_text(&lt;span style=&quot;color: #FF0000&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #00B000&quot;&gt;'{y}OH HAI'&lt;/span&gt;)&lt;br/&gt; &amp;nbsp; self.set_text(&lt;span style=&quot;color: #FF0000&quot;&gt;1&lt;/span&gt;, &lt;span style=&quot;color: #00B000&quot;&gt;'I AM {f}THE{/f} SIGN'&lt;/span&gt;)&lt;br/&gt; &amp;nbsp; self.set_text(&lt;span style=&quot;color: #FF0000&quot;&gt;2&lt;/span&gt;, &lt;span style=&quot;color: #00B000&quot;&gt;'{0}{ma} {dd} &amp;nbsp;{12}'&lt;/span&gt;)&lt;br/&gt; &amp;nbsp; self.resume()&lt;/code&gt;&lt;br /&gt;To dumb down the interface, a frame count of &lt;span style=&quot;font-style: italic;&quot;&gt;n&lt;/span&gt; actually creates a playlist containing &lt;span style=&quot;font-style: italic;&quot;&gt;n&lt;/span&gt; two-letter filenames, &amp;#39;AA&amp;rsquo;&amp;#8230;&amp;rsquo;ZZ&amp;rsquo;.&amp;nbsp; Calling set_text with a frame ID then sets the text of the corresponding file.&amp;nbsp; The set_text method has a dead simple markup language it can use to set text colors and stuff.&lt;br /&gt;&lt;br /&gt;More to come, probably&amp;#8230;</description><category>favotech</category><category>led sign</category><category>python</category><comments>http://www.weirdlooking.com/blog/some-sign-code#comments</comments><wfw:comment>http://www.weirdlooking.com/comments/108</wfw:comment><wfw:commentRss>http://www.weirdlooking.com/rss/comments/108</wfw:commentRss><slash:comments>1</slash:comments></item><item><title>hacking the sign</title><dc:creator>Michael Barton</dc:creator><link>http://www.weirdlooking.com/blog/hacking-the-sign</link><guid>http://www.weirdlooking.com/blog/hacking-the-sign</guid><pubDate>Fri, 05 Sep 2008 13:11:28 +0000</pubDate><description>So right now, I have a simple python app that queries servers over SNMP and displays their load averages on the sign. And the text can flash if a load average seems high, and stuff like that.&amp;nbsp; I&amp;rsquo;ll do more later, I just hacked that together yesterday to get something working.&lt;br /&gt;&lt;br /&gt;If you try this, you may notice that the sign&amp;rsquo;s protocol documentation kind of sucks.&amp;nbsp; Oh, also, its Sigma software only uses that protocol as part of the format of its text files.&amp;nbsp; It has another, more horrible protocol, in which lots of things are framed as file transfers.&amp;nbsp; The files being transfered are also in various ugly formats.&lt;br /&gt;&lt;br /&gt;Maybe I&amp;rsquo;ll post some code later, because this would get super-boring if I started throwing out hex codes and what endian integers to use and how it calculates checksums.&lt;br /&gt;&lt;br /&gt;I will just say that I&amp;rsquo;m kind of wishing I&amp;rsquo;d held out for a better-known brand of sign with a better-documented protocol.</description><comments>http://www.weirdlooking.com/blog/hacking-the-sign#comments</comments><wfw:comment>http://www.weirdlooking.com/comments/107</wfw:comment><wfw:commentRss>http://www.weirdlooking.com/rss/comments/107</wfw:commentRss><slash:comments>10</slash:comments></item><item><title>it's saying hi</title><dc:creator>Michael Barton</dc:creator><link>http://www.weirdlooking.com/blog/its-saying-hi</link><guid>http://www.weirdlooking.com/blog/its-saying-hi</guid><pubDate>Mon, 01 Sep 2008 05:17:18 +0000</pubDate><description>&lt;div style=&quot;float: right; margin: 2px; padding: 2px; border: solid 1px #555555;&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/24388430@N08/2816716296/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.flickr.com%2Fphotos%2F24388430%40N08%2F2816716296%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3290/2816716296_8765a46e8c_m.jpg&quot; alt=&quot;Signbot&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Is that an LED sign on my desk?&amp;nbsp; I believe it is.&lt;br /&gt;&lt;br /&gt;It&amp;rsquo;s a &lt;a href=&quot;http://stores.favotech.com/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fstores.favotech.com%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;FavoTech&lt;/a&gt; model I picked up on eBay that can be programmed by ethernet, USB, serial and IR.&amp;nbsp; My weekend project has been reverse engineering enough of its network protocol to control it programatically.&amp;nbsp; The protocol is all binary stuff over UDP, but I&amp;rsquo;ve made quite a bit of progress in deciphering it.&lt;br /&gt;&lt;br /&gt;It&amp;rsquo;s not all mai tais and yahtzee, though.&amp;nbsp; I somehow broke the sign so that when it first boots up, it spams the network with constant ARP packets until I&amp;rsquo;ve uploaded a playlist.&amp;nbsp; I think it&amp;rsquo;s because I removed the playlist on the flash drive, but I haven&amp;rsquo;t figured out how to get one back on there yet.&amp;nbsp; Against all reason, it&amp;rsquo;s apparently not &amp;ldquo;select the flash drive then upload a playlist&amp;rdquo;.&lt;br /&gt;&lt;br /&gt;I know it has a speaker, because it&amp;rsquo;s forever beeping when it resets.&amp;nbsp; I just haven&amp;rsquo;t figured out any message I can send it to make it beep on cue.&amp;nbsp; I emailed their tech support but haven&amp;rsquo;t heard back yet.&lt;br /&gt;&lt;br /&gt;I&amp;rsquo;m not even being original here &amp;#8211; one of my co-workers has a nearly identical LED sign that used to stream news feeds and &lt;a href=&quot;http://openarena.ws/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fopenarena.ws%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;OA&lt;/a&gt; scores in our office.&lt;br /&gt;&lt;br /&gt;It&amp;rsquo;s pretty fun, though.&amp;nbsp; And I think there&amp;rsquo;s a lot of neat information you could convey in sign form.&amp;nbsp; The only limit is my imagination!&amp;nbsp; Oh, hell.</description><category>led sign</category><comments>http://www.weirdlooking.com/blog/its-saying-hi#comments</comments><wfw:comment>http://www.weirdlooking.com/comments/106</wfw:comment><wfw:commentRss>http://www.weirdlooking.com/rss/comments/106</wfw:commentRss><slash:comments>4</slash:comments></item><item><title>hot asian girls</title><dc:creator>Michael Barton</dc:creator><link>http://www.weirdlooking.com/blog/hot-asian-girls</link><guid>http://www.weirdlooking.com/blog/hot-asian-girls</guid><pubDate>Thu, 29 May 2008 12:41:02 +0000</pubDate><description>&lt;div style=&quot;float: right; margin: 2px; padding: 2px; border: solid 1px #555555;&quot;&gt;&lt;a href=&quot;//www.weirdlooking.com/blog/105/hotasian.png&quot;&gt;&lt;img src=&quot;//www.weirdlooking.com/blog/105/hotasian.png/158:*&quot; alt=&quot;Click to enlargen&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;This is my second-favorite ad from Facebook.&amp;nbsp; It&amp;rsquo;s pretty well-targeted.&amp;nbsp; I mean, how did they know that I like &lt;a href=&quot;http://www.flickr.com/photos/24388430@N08/2339377959/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.flickr.com%2Fphotos%2F24388430%40N08%2F2339377959%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;hot asian girls&lt;/a&gt;?&lt;br /&gt;&lt;br /&gt;My #1 favorite ad I ever saw (but failed to get a screenshot of) had a picture of some dude without a shirt on and said, &amp;ldquo;Try something different!&amp;rdquo;</description><comments>http://www.weirdlooking.com/blog/hot-asian-girls#comments</comments><wfw:comment>http://www.weirdlooking.com/comments/105</wfw:comment><wfw:commentRss>http://www.weirdlooking.com/rss/comments/105</wfw:commentRss><slash:comments>1</slash:comments></item><item><title>par 3 golf</title><dc:creator>Michael Barton</dc:creator><link>http://www.weirdlooking.com/blog/par-3-golf</link><guid>http://www.weirdlooking.com/blog/par-3-golf</guid><pubDate>Thu, 29 May 2008 11:56:39 +0000</pubDate><description>So, it turns out that &lt;a href=&quot;http://greglange.blogspot.com/2008/05/my-darkest-hour.html&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fgreglange.blogspot.com%2F2008%2F05%2Fmy-darkest-hour.html) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;Greg's darkest hour&lt;/a&gt; was one of my brighter hours.&lt;br /&gt;&lt;br /&gt;The thing to take away from our scorecard is not that I lost at par 3 golf.&lt;br /&gt;It&amp;rsquo;s that I lost at par 3 golf by the least that I ever lost by before!&lt;br /&gt;&lt;br /&gt;I&amp;rsquo;m pretty sure I understand how Arnold Palmer feels now.&amp;nbsp; You know, like I&amp;rsquo;ll be remembered for something.&amp;nbsp; Sure, I&amp;rsquo;ll be remembered for golf while he&amp;rsquo;s remembered for mixing lemonade and &lt;a href=&quot;http://www.googlefight.com/index.php?lang=en_GB&amp;amp;word1=ice+tea&amp;amp;word2=iced+tea&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.googlefight.com%2Findex.php%3Flang%3Den_GB%26amp%3Bword1%3Dice%2Btea%26amp%3Bword2%3Diced%2Btea) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;iced tea&lt;/a&gt;, but the analogy still holds.</description><comments>http://www.weirdlooking.com/blog/par-3-golf#comments</comments><wfw:comment>http://www.weirdlooking.com/comments/104</wfw:comment><wfw:commentRss>http://www.weirdlooking.com/rss/comments/104</wfw:commentRss><slash:comments>1</slash:comments></item><item><title>i just liked this picture...</title><dc:creator>Michael Barton</dc:creator><link>http://www.weirdlooking.com/blog/i-just-liked-this-picture</link><guid>http://www.weirdlooking.com/blog/i-just-liked-this-picture</guid><pubDate>Sun, 18 May 2008 01:43:09 +0000</pubDate><description>&lt;div class=&quot;flickr-frame&quot;&gt;	&lt;a href=&quot;http://www.flickr.com/photos/24388430@N08/2500909208/&quot; title=&quot;photo sharing&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3126/2500909208_28275baf8e.jpg&quot; class=&quot;flickr-photo&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class=&quot;flickr-caption&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/24388430@N08/2500909208/&quot;&gt;developer conference at work&lt;/a&gt;, originally uploaded by &lt;a href=&quot;http://www.flickr.com/people/24388430@N08/&quot;&gt;red_bo&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;				&lt;p class=&quot;flickr-yourcomment&quot;&gt;	You can tell nobody said &quot;cheese!&quot; first.&lt;br /&gt;&lt;br /&gt;That's Nels, me, and Greg at a company developers' conference.&lt;/p&gt;</description><comments>http://www.weirdlooking.com/blog/i-just-liked-this-picture#comments</comments><wfw:comment>http://www.weirdlooking.com/comments/103</wfw:comment><wfw:commentRss>http://www.weirdlooking.com/rss/comments/103</wfw:commentRss><slash:comments>2</slash:comments></item><item><title>glass box unit testing can bite me</title><dc:creator>Michael Barton</dc:creator><link>http://www.weirdlooking.com/blog/glass-box-unit-testing-can-bite-me</link><guid>http://www.weirdlooking.com/blog/glass-box-unit-testing-can-bite-me</guid><pubDate>Thu, 24 Apr 2008 09:32:37 +0000</pubDate><description>I&amp;rsquo;ve seen unit tests where everything touched by the code is mocked out, and the mocks are intelligent in such a way that the tests fail if the mocked methods aren&amp;rsquo;t all called with correct arguments.&amp;nbsp; It winds up being nearly a line for line check of the implementation of the code, and is about the most horrible thing I think I&amp;rsquo;ve ever heard of.&lt;br /&gt;&lt;br /&gt;I have basically the same problem with tests against private methods.&lt;br /&gt;&lt;br /&gt;Changing implementation details without changing behavior called &amp;ldquo;refactoring&amp;rdquo; and is one of the selling points of unit tests.&amp;nbsp; If a class behaves exactly the same today as it did yesterday, its unit tests shouldn&amp;rsquo;t suddenly &lt;span style=&quot;font-style: italic;&quot;&gt;fail&lt;/span&gt;, even if someone was mucking around inside it.&lt;br /&gt;&lt;br /&gt;If you just want to make sure nobody changes the code, why not get a checksum of the file?&amp;nbsp; It&amp;rsquo;ll be a lot less work and have about the same effect.&amp;nbsp; Ta freakin&amp;#39; da.&lt;br /&gt;&lt;br /&gt;And I&amp;rsquo;m not saying that there aren&amp;rsquo;t exceptions, just that they &lt;span style=&quot;font-style: italic;&quot;&gt;are&lt;/span&gt; exceptions.</description><category>programming</category><category>unit tests</category><comments>http://www.weirdlooking.com/blog/glass-box-unit-testing-can-bite-me#comments</comments><wfw:comment>http://www.weirdlooking.com/comments/102</wfw:comment><wfw:commentRss>http://www.weirdlooking.com/rss/comments/102</wfw:commentRss><slash:comments>1</slash:comments></item><item><title>so it began...</title><dc:creator>Michael Barton</dc:creator><link>http://www.weirdlooking.com/blog/so-it-began</link><guid>http://www.weirdlooking.com/blog/so-it-began</guid><pubDate>Mon, 17 Mar 2008 07:16:36 +0000</pubDate><description>&lt;div class=&quot;flickr-frame&quot;&gt;	&lt;a href=&quot;http://www.flickr.com/photos/24388430@N08/2339362891/&quot; title=&quot;photo sharing&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3052/2339362891_71ec0ef842.jpg&quot; class=&quot;flickr-photo&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class=&quot;flickr-caption&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/24388430@N08/2339362891/&quot;&gt;so it began...&lt;/a&gt;, originally uploaded by &lt;a href=&quot;http://www.flickr.com/people/24388430@N08/&quot;&gt;red_bo&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;				&lt;p class=&quot;flickr-yourcomment&quot;&gt;	Here, Brian begins his rapid downward spiral by loitering in front of&lt;br /&gt;a &quot;no loitering&quot; sign.&lt;br /&gt;&lt;br /&gt;He would not be seen or heard from for three days.&lt;/p&gt;</description><comments>http://www.weirdlooking.com/blog/so-it-began#comments</comments><wfw:comment>http://www.weirdlooking.com/comments/99</wfw:comment><wfw:commentRss>http://www.weirdlooking.com/rss/comments/99</wfw:commentRss><slash:comments>0</slash:comments></item></channel></rss>
