<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D0UFQ38yfyp7ImA9WhRUE0U.&quot;"><id>tag:blogger.com,1999:blog-30547433</id><updated>2012-01-24T01:06:52.197-05:00</updated><category term="ruby" /><category term="facebook" /><category term="bad code" /><category term="spring contracts" /><category term="contract4j" /><category term="web app" /><category term="jwebapp" /><category term="olpc" /><category term="java" /><category term="debugging" /><category term="expander" /><category term="ajax" /><category term="utility class" /><category term="mixin" /><category term="singleton" /><category term="aop" /><category term="jsp" /><category term="metaprogramming" /><category term="textmate" /><category term="rvm" /><category term="irritant" /><category term="ux" /><category term="aspectj" /><category term="jvm" /><category term="bash" /><category term="eeepc" /><category term="validation" /><category term="powermock" /><category term="dzone" /><category term="jquery" /><category term="interview" /><category term="has_many" /><category term="struts" /><category term="easymock" /><category term="mocking" /><category term="rails" /><category term="eiffel" /><category term="design by contract" /><category term="rail" /><category term="fail" /><category term="command line" /><category term="testing" /><category term="jee" /><category term="subnotebook" /><category term="closures" /><category term="authlogic" /><category term="rake" /><category term="beginner" /><title>Bucky Bits</title><subtitle type="html">Programming and rants for the "Developmentally Disabled."</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://buckybits.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/BuckyBits" /><feedburner:info uri="buckybits" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DUADQHs4eyp7ImA9WhRSEk0.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-5330159547965580300</id><published>2011-11-12T10:20:00.001-05:00</published><updated>2011-11-13T13:09:31.533-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-13T13:09:31.533-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="utility class" /><category scheme="http://www.blogger.com/atom/ns#" term="easymock" /><category scheme="http://www.blogger.com/atom/ns#" term="testing" /><category scheme="http://www.blogger.com/atom/ns#" term="singleton" /><category scheme="http://www.blogger.com/atom/ns#" term="powermock" /><category scheme="http://www.blogger.com/atom/ns#" term="mocking" /><title>Testing singletons while avoiding their constructors</title><summary type="html">Singletons are evil, and here's why.

Fair enough. Yet they exist, and they're not intrinsically evil--just misused. Can we mock enough to make testing them feasible? Yep, and here's a Contrived Example™ that shows how (and why we might want to).

"Embedded" singletons or utility classes can make testing is problematic. Injected singletons are different; then it's an issue of whether or not it &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/sMI5BjrWAvo" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/5330159547965580300/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=5330159547965580300" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5330159547965580300?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5330159547965580300?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/sMI5BjrWAvo/testing-singletons-and-static-classes.html" title="Testing singletons while avoiding their constructors" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/11/testing-singletons-and-static-classes.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EFQnw5cSp7ImA9WhRTGUU.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-5528597552995715379</id><published>2011-11-10T22:07:00.001-05:00</published><updated>2011-11-10T22:20:13.229-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-10T22:20:13.229-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="rake" /><title>A trip to the Rake-track.</title><summary type="html">(Because it's like "racetrack", and it makes Rake tasks faster, and... oh, never mind.)

Tired of waiting for Ruby to spin up just so you can run a "routes" command, or your latest "db:migrate"?

Use rake-sh and start up a rake console for running tasks without the initial spin up. It'll take a "rake routes" from four seconds down to under a second. Rake task completion? Naturally. Use "t" for &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/pH7nEcR6Nk8" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/5528597552995715379/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=5528597552995715379" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5528597552995715379?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5528597552995715379?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/pH7nEcR6Nk8/trip-to-rake-track.html" title="A trip to the Rake-track." /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/11/trip-to-rake-track.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcFSHs4fSp7ImA9WhdVGUU.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-5860506132303955386</id><published>2011-09-15T22:07:00.001-04:00</published><updated>2011-09-25T15:46:59.535-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-25T15:46:59.535-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><category scheme="http://www.blogger.com/atom/ns#" term="metaprogramming" /><title>Rails 3 Custom Validator Quandary -- Solution Step One</title><summary type="html">Remember when I had a Rails 3 custom validator quandary? My bottom-line question was "how should I access a specific error condition, cleanly, in both an action, and a template?" I sketched a few solutions, ranging from checking for a specific error message to providing a function that indicates if the error has occurred.

For now, I want simple boolean methods on the model to encapsulate the &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/-8GOKlx6Xuo" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/5860506132303955386/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=5860506132303955386" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5860506132303955386?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5860506132303955386?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/-8GOKlx6Xuo/remember-when-i-had-rails-3-custom.html" title="Rails 3 Custom Validator Quandary -- Solution Step One" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/09/remember-when-i-had-rails-3-custom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIFQ3c6fCp7ImA9WhdaF08.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-3824387112538042604</id><published>2011-09-06T23:02:00.000-04:00</published><updated>2011-10-27T09:51:52.914-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-27T09:51:52.914-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><category scheme="http://www.blogger.com/atom/ns#" term="ajax" /><category scheme="http://www.blogger.com/atom/ns#" term="ux" /><title>Simple Ajax property toggle in Rails 3.0</title><summary type="html">Entry-level overview of one way to add trivial Ajax functionality to a Rails 3.0 app, originally written for a specific audience. The repository is on github.



Let's say we have an Article model with an "approved" flag. We need to be able to toggle this flag. Normal scaffolding would have us view the article, click a checkbox, and submit. We'll keep that functionality, but add a simple &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/Nd5l3RoJpes" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/3824387112538042604/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=3824387112538042604" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/3824387112538042604?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/3824387112538042604?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/Nd5l3RoJpes/simple-ajax-property-toggle-in-rails-30.html" title="Simple Ajax property toggle in Rails 3.0" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>4</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/09/simple-ajax-property-toggle-in-rails-30.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQNRH46cCp7ImA9WhdWEks.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-1476821717004539724</id><published>2011-09-05T20:15:00.000-04:00</published><updated>2011-09-05T20:19:55.018-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-05T20:19:55.018-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="authlogic" /><category scheme="http://www.blogger.com/atom/ns#" term="rail" /><title>Example app test failures from authlogic user sessions</title><summary type="html">This question on stackoverflow led me to believe that if I actually ran rake test that my example app's tests would fail--and they did, with the same error. (Why I wasn't running tests from the beginning? Meh!) The tests throw up wads of stack trace, headed with this:

SQLException: no such table: user_sessions: DELETE FROM "user_sessions" WHERE 1=1

What's causing this error? We created our user&lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/8ymQJ45zvPM" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/1476821717004539724/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=1476821717004539724" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/1476821717004539724?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/1476821717004539724?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/8ymQJ45zvPM/example-app-test-failures-from.html" title="Example app test failures from authlogic user sessions" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/09/example-app-test-failures-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYCRnc4eSp7ImA9WhRXF0g.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-5563457113011215020</id><published>2011-09-05T12:24:00.000-04:00</published><updated>2011-12-24T13:09:27.931-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-24T13:09:27.931-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="rvm" /><category scheme="http://www.blogger.com/atom/ns#" term="textmate" /><title>TextMate, rvm, ActiveSupport outside of Rails, "require"s from current directory, all together now!</title><summary type="html">I'm prototyping some calendar/date stuff for a Rails app in standalone scripts, and want access to both normal Rails things (in this case, ActiveSupport's date math, like Date.today - 3.days) and my own classes within the prototyping directory. I'd like to continue using TextMate's "Run" command to run the current buffer as a Ruby script, since it's convenient. I'm using rvm; my prototyping &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/krTBmzBLZHc" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/5563457113011215020/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=5563457113011215020" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5563457113011215020?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5563457113011215020?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/krTBmzBLZHc/textmate-rvm-activesupport-outside-of.html" title="TextMate, rvm, ActiveSupport outside of Rails, &quot;require&quot;s from current directory, all together now!" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/09/textmate-rvm-activesupport-outside-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cBQX46fip7ImA9WhdWEk4.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-8432445425039616941</id><published>2011-09-05T06:00:00.000-04:00</published><updated>2011-09-05T09:57:30.016-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-05T09:57:30.016-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><category scheme="http://www.blogger.com/atom/ns#" term="authlogic" /><title>Using email or nickname to log in using authlogic and Rails 3</title><summary type="html">
This is a continuation of my first authlogic/Rails 3 post.

Authlogic users have both "login" and "email" properties by default. I wanted to allow users to log in via their email address or nickname. I tackled this in two steps. First, switch to logging in using the "email" property. Second, create a "nickname" property, and allow users to log in with either one. (Yes, I actually wanted to call &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/fRtY4OgDxkU" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/8432445425039616941/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=8432445425039616941" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/8432445425039616941?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/8432445425039616941?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/fRtY4OgDxkU/using-email-or-nickname-to-log-in-using.html" title="Using email or nickname to log in using authlogic and Rails 3" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/09/using-email-or-nickname-to-log-in-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcDQ3w5fyp7ImA9WhdWEks.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-5429053488218358764</id><published>2011-09-04T20:32:00.000-04:00</published><updated>2011-09-05T18:34:32.227-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-05T18:34:32.227-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><category scheme="http://www.blogger.com/atom/ns#" term="authlogic" /><title>Rails 3 + authlogic explorations</title><summary type="html">I've started a simple Rails 3 + authlogic example project on github, mostly for myself to experiment with. Right now it's basically a copy of this post's implementation (and unfinished at that), but I'll be expanding it over the next few days in various ways.

As it stands, the "application" (I use the term loosely) consists of a home page (root path) requiring login, and login/logout actions. &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/u9tSf8oFvfQ" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/5429053488218358764/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=5429053488218358764" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5429053488218358764?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5429053488218358764?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/u9tSf8oFvfQ/rails-3-authlogic-explorations.html" title="Rails 3 + authlogic explorations" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/09/rails-3-authlogic-explorations.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MHQno6fip7ImA9WhdXFUQ.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-1751590459119074057</id><published>2011-08-29T01:23:00.000-04:00</published><updated>2011-08-29T01:23:53.416-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-29T01:23:53.416-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="has_many" /><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><title>Associating has_many relationships in Rails 3 using checkboxes</title><summary type="html">(Not checkboxes, in my case, but a checkbox example is easy, and more common.)

Originally I thought I needed accepts_nested_attributes_for, but that seems to be mostly for when we're creating the related objects, which I'm not--I need to save relationships to existing objects.

My example (github) uses a simple product/category relationship. We need to get a product's categories, we need to get &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/Kqv1_ZSrZww" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/1751590459119074057/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=1751590459119074057" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/1751590459119074057?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/1751590459119074057?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/Kqv1_ZSrZww/associating-hasmany-relationships-in.html" title="Associating has_many relationships in Rails 3 using checkboxes" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/08/associating-hasmany-relationships-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEACRXY5fSp7ImA9WhdXEEk.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-2603041430485413107</id><published>2011-08-22T16:34:00.001-04:00</published><updated>2011-08-22T16:59:24.825-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-22T16:59:24.825-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="web app" /><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="ajax" /><title>Preventing double-clicks in jQuery/Ajax-y handlers</title><summary type="html">Throwing this out there to see what people thing--I suspect there are better, cleaner ways to do this, and I'm wondering what they are.
$.fn.click1 = function(fn) {
  $(this).data('clicked', false);
  $(this).click(function(o) {
    if ($(this).data('clicked')) return false;
    $(this).data('clicked', true);
    fn(o);
    return false;
  });
};

(I return false because I know I don't &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/llTtmao8VQ4" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/2603041430485413107/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=2603041430485413107" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/2603041430485413107?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/2603041430485413107?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/llTtmao8VQ4/preventing-double-clicks-in-jqueryajax.html" title="Preventing double-clicks in jQuery/Ajax-y handlers" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/08/preventing-double-clicks-in-jqueryajax.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04EQn85fip7ImA9WhdRGU0.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-5405900240594532676</id><published>2011-08-09T09:33:00.002-04:00</published><updated>2011-08-09T13:11:43.126-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-09T13:11:43.126-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><category scheme="http://www.blogger.com/atom/ns#" term="validation" /><title>Rails 3 Custom Validator Quandary</title><summary type="html">I'm trying to figure out the "best" way to support discovery of custom validator errors on a Rails 3 model.

My model has both standard and custom validators. I need to check for validation errors from the custom validators, in both controller and template.

My slap-dash solution was to add an additional error message keyed to the field name suffixed with a validator-specific extension. For &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/0v9bBN-O8zg" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/5405900240594532676/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=5405900240594532676" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5405900240594532676?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5405900240594532676?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/0v9bBN-O8zg/rails-3-validation-custom-validator.html" title="Rails 3 Custom Validator Quandary" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/08/rails-3-validation-custom-validator.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAERng_eip7ImA9WhdRGE0.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-2206158584491567902</id><published>2011-08-08T08:46:00.001-04:00</published><updated>2011-08-08T08:48:27.642-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-08T08:48:27.642-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="bash" /><category scheme="http://www.blogger.com/atom/ns#" term="command line" /><category scheme="http://www.blogger.com/atom/ns#" term="beginner" /><title>Bash function of the day</title><summary type="html">I push the command line on people, because it's generally the most efficient way to do several different things. My devs resist me, although I don't understand why... part of it is that most places I've worked at are Windows houses. No problem, say I: Cygwin to the rescue. Seriously, gang, I'm not just making this up.

(I'll grant, however, that there are some Finder/Explorer replacements that &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/11s6OYv0bYQ" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/2206158584491567902/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=2206158584491567902" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/2206158584491567902?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/2206158584491567902?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/11s6OYv0bYQ/bash-function-of-day.html" title="Bash function of the day" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/08/bash-function-of-day.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4BQn8-fip7ImA9WhdRFUo.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-1058929123874898519</id><published>2011-08-05T14:07:00.003-04:00</published><updated>2011-08-05T15:02:33.156-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-05T15:02:33.156-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="facebook" /><category scheme="http://www.blogger.com/atom/ns#" term="debugging" /><title>Mysterious Facebook JS error, resolved!</title><summary type="html">Two FB apps, both using FB.ui to publish to a stream. One worked, one didn't, nobody knew why. I needed to know.Nutshell: FB JS code was inadvertently included twice (not by me, which always makes things more difficult). This caused the app_id and app_key values in the FB.ui call to go away--everything else was there, but two pieces critical (obviously) weren't. Note that the app code didn't &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/onGalUtBbKc" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/1058929123874898519/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=1058929123874898519" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/1058929123874898519?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/1058929123874898519?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/onGalUtBbKc/mysterious-facebook-js-error-resolved.html" title="Mysterious Facebook JS error, resolved!" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/08/mysterious-facebook-js-error-resolved.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYGR3g5fSp7ImA9WhRXF0g.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-4293632655696491221</id><published>2011-07-01T17:11:00.006-04:00</published><updated>2011-12-24T13:08:46.625-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-24T13:08:46.625-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="rvm" /><category scheme="http://www.blogger.com/atom/ns#" term="textmate" /><title>Textmate and rvm, behave!</title><summary type="html">
Several sites describe the process necessary to get TextMate to use either a wrapped (via the rvm wrapper command) or an rvm-specified default Ruby interpreter (including gemsets, basically anything you can use with the rvm use command).


Following just those steps never worked for me, even when I explicitly gave a wrapped TM_RUBY: it would still do an exec ruby in there and blow up. I've &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/-GAtx6ygkgo" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/4293632655696491221/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=4293632655696491221" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/4293632655696491221?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/4293632655696491221?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/-GAtx6ygkgo/textmate-and-rvm-behave.html" title="Textmate and rvm, behave!" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/07/textmate-and-rvm-behave.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcGRnk4fCp7ImA9Wx9VFE8.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-4434314741406881843</id><published>2011-01-30T17:16:00.005-05:00</published><updated>2011-01-30T17:20:27.734-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-30T17:20:27.734-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="fail" /><category scheme="http://www.blogger.com/atom/ns#" term="interview" /><category scheme="http://www.blogger.com/atom/ns#" term="struts" /><title>Java/Struts Interview Back Online!</title><summary type="html">Aww yeah; it's back, YouTubier than ever. (The audio conversion is a bit spikey--I'll have to try it again I think.)Watch it on YouTube!Myeeeeah update! Update! myeeeeeeeeeaaaaaaaaa Update! Implementing googling!For those keeping score at home... still haven't found anyone I actually *want* to hire, although there have been a few people that would have been solid workers, I really need someone &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/EO4qQrwpOk4" height="1" width="1"/&gt;</summary><link rel="related" href="http://www.youtube.com/watch?v=a8D1SLIvcew" title="Java/Struts Interview Back Online!" /><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/4434314741406881843/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=4434314741406881843" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/4434314741406881843?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/4434314741406881843?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/EO4qQrwpOk4/javastruts-interview-back-online.html" title="Java/Struts Interview Back Online!" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2011/01/javastruts-interview-back-online.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4NRHcycCp7ImA9WxFaFEQ.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-5065800227081913149</id><published>2010-07-18T18:37:00.002-04:00</published><updated>2010-07-18T18:43:15.998-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-18T18:43:15.998-04:00</app:edited><title>Back from the dead.</title><summary type="html">As I prepare to interview developers again, I'm reminded of my last post--while part of me is curious to see how this round will go, part of me dreads the process. I also noticed I haven't blogged in a Really Long Time and really should start again.*grumble*One issue I know I'll have this time around is that we're really running in a legacy environment, but I need developers with current &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/__jGeb8wS-o" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/5065800227081913149/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=5065800227081913149" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5065800227081913149?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5065800227081913149?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/__jGeb8wS-o/back-from-dead.html" title="Back from the dead." /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2010/07/back-from-dead.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUGSXg8fyp7ImA9Wx9VFE8.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-7837824396146236126</id><published>2009-06-20T13:07:00.006-04:00</published><updated>2011-01-30T17:23:48.677-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-30T17:23:48.677-05:00</app:edited><title>Best JEE Interview Ever?</title><summary type="html">UPDATED WITH NEW LINK TO AUDIO.Some time ago a friend forwarded me an audio recording of an interview he conducted. No names are used (except for John's), no companies are identified--to protect the (very) guilty. A few words were unintelligible. While the transcript it entertaining on its own, when read along with the audio it may actually kill you. Listen to the interview on YouTube.Update &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/Ew1CIo8Nxc0" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/7837824396146236126/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=7837824396146236126" title="21 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/7837824396146236126?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/7837824396146236126?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/Ew1CIo8Nxc0/best-jee-interview-ever.html" title="Best JEE Interview Ever?" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>21</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2009/06/best-jee-interview-ever.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ACSX09eip7ImA9WxJSEU0.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-7950764810937134181</id><published>2009-04-30T10:15:00.004-04:00</published><updated>2009-04-30T10:29:28.362-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-30T10:29:28.362-04:00</app:edited><title>Good Programmers ARE Lazy...</title><summary type="html">...but not in the way this article seems to think the phrase means. Did anybody really think that by saying "Good programmers are lazy" we meant "showing a lack of effort or care", or "characterized by lack of effort or activity"? Come on: it's a humorous expression with enough truth in it to take seriously.When people say that "good programmers are lazy" it means that good programmers try to &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/GhnzGfrXgJs" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/7950764810937134181/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=7950764810937134181" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/7950764810937134181?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/7950764810937134181?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/GhnzGfrXgJs/good-programmers-are-lazy.html" title="Good Programmers ARE Lazy..." /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2009/04/good-programmers-are-lazy.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QMQHk6cSp7ImA9WxJTFEQ.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-6806217202462801535</id><published>2009-04-23T09:24:00.006-04:00</published><updated>2009-04-23T10:03:01.719-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-23T10:03:01.719-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="design by contract" /><category scheme="http://www.blogger.com/atom/ns#" term="eiffel" /><title>Java is NOT Design by Contract.</title><summary type="html">In a recent DZone comment thread somebody stated:[...] Java did great in pushing design-by-contract [...]This caught me off-guard; I've never heard anybody refer to Java as a DbC language before. The rationale provided was that Java was the first general-purpose language to push interfaces--but interfaces are probably the weakest form of DbC I can think of. (We'll ignore that Eiffel predates Java&lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/Tt0IalTfOic" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/6806217202462801535/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=6806217202462801535" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/6806217202462801535?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/6806217202462801535?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/Tt0IalTfOic/java-is-not-design-by-contract.html" title="Java is NOT Design by Contract." /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2009/04/java-is-not-design-by-contract.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UMR3g8eSp7ImA9WxJVEkw.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-4997345809812507797</id><published>2009-04-20T12:15:00.008-04:00</published><updated>2009-06-28T13:48:06.671-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-28T13:48:06.671-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="jsp" /><category scheme="http://www.blogger.com/atom/ns#" term="bad code" /><title>People Still Do JSP Wrong--But Why?</title><summary type="html">The JavaRanch is a site for "Java greenhorns" (although it caters to quite advanced users as well). As such sometimes things are posted there that make even relatively new Java programmers cringe.A recent post in the Struts forum asked a question about frames, which ends up being the least of the problems. The code snippet posted looked like this, spacing preserved: &amp;lt;body&amp;gt;  &amp;lt;table width="100%" &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/oFr3g3PBRX4" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/4997345809812507797/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=4997345809812507797" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/4997345809812507797?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/4997345809812507797?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/oFr3g3PBRX4/people-still-do-jsp-wrong-but-why.html" title="People Still Do JSP Wrong--But Why?" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2009/04/people-still-do-jsp-wrong-but-why.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIGQn0-fSp7ImA9WhdXFUQ.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-1693818062306208466</id><published>2009-04-19T14:44:00.005-04:00</published><updated>2011-08-29T01:58:43.355-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-29T01:58:43.355-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="dzone" /><title>Does Anyone Love Java? Nah.</title><summary type="html">A post claims some people love Java. Fair enough: I'm sure some people love Java.

How many thought leaders love Java? How many people whose opinions we care about love Java? I'd wager it's a small number. Many of the most prominent in the Java world spend their time working around Java's limitations via frameworks, environments, and tools.

Do they "love Java", or do they react to its weaknesses&lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/RZGkg1tBEMY" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/1693818062306208466/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=1693818062306208466" title="18 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/1693818062306208466?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/1693818062306208466?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/RZGkg1tBEMY/does-anyone-love-java-nah.html" title="Does Anyone Love Java? Nah." /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>18</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2009/04/does-anyone-love-java-nah.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcAR387fCp7ImA9WxJTEUo.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-4303882696266504861</id><published>2008-11-23T12:42:00.007-05:00</published><updated>2009-04-19T16:30:46.104-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-19T16:30:46.104-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="web app" /><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="dzone" /><category scheme="http://www.blogger.com/atom/ns#" term="jwebapp" /><category scheme="http://www.blogger.com/atom/ns#" term="jee" /><title>Do Java Web Application Frameworks *Really* Provide Too Much?</title><summary type="html">The other day we witnessed a DZone disaster. The article (Web Frameworks - We Need Less, But They Keep Adding More (Part 1)) was a five-paragraph claim that typical/most Java web frameworks were full of bloat and too complex, and that this is bad. I don't think anybody would argue that. The disaster's underpinnings? He was voted down, and called the downvoter a jerk.I also voted the article down-&lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/-YytwQnUvAk" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/4303882696266504861/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=4303882696266504861" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/4303882696266504861?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/4303882696266504861?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/-YytwQnUvAk/do-java-web-application-frameworks.html" title="Do Java Web Application Frameworks *Really* Provide Too Much?" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>5</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2008/11/do-java-web-application-frameworks.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EGQXk9fyp7ImA9WxRRFU8.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-5765441145790759127</id><published>2008-02-01T11:43:00.008-05:00</published><updated>2008-09-27T11:33:40.767-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-27T11:33:40.767-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="closures" /><category scheme="http://www.blogger.com/atom/ns#" term="irritant" /><title>Today's Java Irritant: No sense of closure.</title><summary type="html">There's still enough back-and-forth about the inclusion of closures in Java 7 that I'm nervous it might not make it in to the language.James Gosling supports the addition of closures and states that the reason they weren't there in the first place was due to time pressures and seems to have some regret about their absence (understandable; he's a Pretty Smart Dude and probably feels the pain of &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/AnEnpLrZ1HY" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/5765441145790759127/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=5765441145790759127" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5765441145790759127?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/5765441145790759127?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/AnEnpLrZ1HY/todays-java-irritant-no-sense-of.html" title="Today's Java Irritant: No sense of closure." /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2008/02/todays-java-irritant-no-sense-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUDQ3s_fyp7ImA9WhdXFUQ.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-3304666922671310564</id><published>2007-12-31T11:02:00.004-05:00</published><updated>2011-08-29T01:37:52.547-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-29T01:37:52.547-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="design by contract" /><category scheme="http://www.blogger.com/atom/ns#" term="spring contracts" /><category scheme="http://www.blogger.com/atom/ns#" term="contract4j" /><category scheme="http://www.blogger.com/atom/ns#" term="aop" /><category scheme="http://www.blogger.com/atom/ns#" term="irritant" /><category scheme="http://www.blogger.com/atom/ns#" term="aspectj" /><title>Today's Java Irritant: Design-by-Contract Disconnects.</title><summary type="html">Design-by-contract systems enforce API behavior. In Eiffel, contracts specify both internal and external behavior, at the language level.
connect_to_server (server: SOCKET)
require
server /= Void and then server.address /= Void
-- etc.
end

This does what it looks like, at runtime. (/= == != :)

The cost of doing the same in Java is higher; most frameworks use some form of aspect-oriented &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/ubG76BzW_W8" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/3304666922671310564/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=3304666922671310564" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/3304666922671310564?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/3304666922671310564?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/ubG76BzW_W8/todays-java-irritant-design-by-contract.html" title="Today's Java Irritant: Design-by-Contract Disconnects." /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>4</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2007/12/todays-java-irritant-design-by-contract.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IBQ3w9fip7ImA9WB9aEUw.&quot;"><id>tag:blogger.com,1999:blog-30547433.post-2234502835881442347</id><published>2007-12-19T11:28:00.001-05:00</published><updated>2007-12-31T11:45:52.266-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-12-31T11:45:52.266-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="olpc" /><category scheme="http://www.blogger.com/atom/ns#" term="subnotebook" /><category scheme="http://www.blogger.com/atom/ns#" term="eeepc" /><title>OLPC: Minimal First Impressions</title><summary type="html">Hooray, my OLPC arrived this morning!Without having the time to go in to any detail, here some initial first impressions.- It's really small, but the carrying handle and LCD hinge/swivel assembly make it larger than my Eee PC. Not a huge issue for me, and the hinge/swivel makes for some cool functionality that I want in a small notebook. Handle I can live without, but it won't be a deciding &lt;img src="http://feeds.feedburner.com/~r/BuckyBits/~4/TY2m81OwGIM" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://buckybits.blogspot.com/feeds/2234502835881442347/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=30547433&amp;postID=2234502835881442347" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/2234502835881442347?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/30547433/posts/default/2234502835881442347?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuckyBits/~3/TY2m81OwGIM/olpc-minimal-first-impressions.html" title="OLPC: Minimal First Impressions" /><author><name>Dave Newton</name><uri>http://www.blogger.com/profile/13420113088393527059</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="27" height="32" src="http://1.bp.blogspot.com/-ZxOE-ipkRqU/TmUmUP39DFI/AAAAAAAAAZ8/umY_zZgjjrU/s220/new_haircut_headshot.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://buckybits.blogspot.com/2007/12/olpc-minimal-first-impressions.html</feedburner:origLink></entry></feed>

