<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>I.NFECTIO.US comments</title>
    <link>http://i.nfectio.us</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>"Nothing in life is worth doing if you have no life while doing it"</description>
    <item>
      <title>"Working with the PeoplePicker Data Values in SharePoint" by Zach Rosenfield</title>
      <description>Great to see these cool PowerShell tricks for SharePoint being posted online (and thanks for adding the Dispose!).</description>
      <pubDate>Tue, 30 Oct 2007 11:58:36 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:bc071ef1-044d-4ef5-bd37-3bb88525ec1e</guid>
      <link>http://i.nfectio.us/articles/2007/10/28/working-with-the-peoplepicker-data-values-in-sharepoint#comment-273</link>
    </item>
    <item>
      <title>"Deprecations in Rails 1.2" by Joe Ruby</title>
      <description>It's a major pain in the ass trying to read the code in that box with its tiny horizontal scroll bar.</description>
      <pubDate>Mon, 07 May 2007 16:28:48 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:8f72242b-8994-49f6-9e33-20446d697309</guid>
      <link>http://i.nfectio.us/articles/2006/11/02/deprecations-in-rails-1-2#comment-272</link>
    </item>
    <item>
      <title>"Implement acts_as_threaded without a plugin" by Michael Carney</title>
      <description>Sorry about the formattingg above. I couldn't figure out how to get paragraphs and code in. But the idea is to set lft=1, rgt=2, and depth=3 in the after_create callback at the same timee that you set root_id=id. 

Any thoughts are appreciated.

Thanks.</description>
      <pubDate>Tue, 27 Mar 2007 09:12:55 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:2294fae3-2905-4a1d-a4e4-3db64114fea4</guid>
      <link>http://i.nfectio.us/articles/2006/03/31/implement-acts_as_threaded-without-a-plugin#comment-271</link>
    </item>
    <item>
      <title>"Implement acts_as_threaded without a plugin" by Michael Carney</title>
      <description>I ran into a similar problem to Philip Tsai above where I was getting the first response to an item having a lft child with a value of zero. I followed his advice, but then ran into a different problem. If you have a post with no children and call children_count, you end up with a problem because of the NULL values for lft and rgt. I ended up with a different solution which I think feels better. I modified the original code from above as follows:
[code]
 def after_create
    # Update the parent root_id with its id
    if self[:parent_id].to_i.zero?
      self[:root_id] = self[:id]
      self[:lft] = 1
      self[:rgt] = 2
      self[:depth] = 0
      self.save
    else
      parent.add_child self
    end
  end
[/code]

The values of 1 or 2 are the default values that are assumed by nested_set if lft or rgt is NULL, but by setting them here all of the code works properly even if there are no children. For instance, calling all_children returns an empty array rather than barfing because of a poorly formed SQL query (with things like "(rgt  )" because the value of rgt is NULL). 

This seems pretty bullet proof. Does anybody see any problems with it?

Thanks.
</description>
      <pubDate>Tue, 27 Mar 2007 08:33:27 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:cc4eab32-fc48-4945-ae12-e56618f6990e</guid>
      <link>http://i.nfectio.us/articles/2006/03/31/implement-acts_as_threaded-without-a-plugin#comment-270</link>
    </item>
    <item>
      <title>"Macbook Battery Dead" by osric</title>
      <description>so I went to a nearby Apple Store yesterday (Saturday) AM and ended up being the first to see a Genius. He tried out one of their batteries, booted into single user mode, checked inventory and gave me a new battery. Took all of ten minutes. I was pleasantly surprised -- my invoice was $0.</description>
      <pubDate>Sun, 04 Mar 2007 07:05:43 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:a668d098-a9b2-4814-8b83-9a840fe01c64</guid>
      <link>http://i.nfectio.us/articles/2006/06/24/macbook-battery-dead#comment-269</link>
    </item>
    <item>
      <title>"Macbook Battery Dead" by osric</title>
      <description>my battery just stopped being recognized this evening. just a black x on the battery indicator on the menu bar. this is a 1/11/06 vintage black macbook. kind of sad that its battery is already wasted.</description>
      <pubDate>Fri, 02 Mar 2007 20:17:58 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:cab1fc21-9396-4e37-a6ec-1da01f2d9968</guid>
      <link>http://i.nfectio.us/articles/2006/06/24/macbook-battery-dead#comment-268</link>
    </item>
    <item>
      <title>"RAILS_ROOT and Dir.chdir" by jteam</title>
      <description>I had the same problem - I was building a Ferret search index in a controller (I believe Ferret is doing Dir.chdir at some point) and afterwards ror couldn't compile/resolve the *.rhtml files anymore...
My solution was to set the RAILS_ROOT in environment.rb. It does the job for now.</description>
      <pubDate>Fri, 02 Mar 2007 02:18:45 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:4649da89-0587-4865-ae65-1383ed1a4d73</guid>
      <link>http://i.nfectio.us/articles/2007/02/10/rails_root-and-dir-chdir#comment-267</link>
    </item>
    <item>
      <title>"ActiveRecord Calculations" by Eric</title>
      <description>Hi!

Is this still possible to use this patch with Rails 1.2?</description>
      <pubDate>Thu, 01 Mar 2007 04:22:26 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:a75708fc-352b-41d9-8307-02fb70c2cd13</guid>
      <link>http://i.nfectio.us/articles/2006/11/05/activerecord-calculations#comment-266</link>
    </item>
    <item>
      <title>"Defining Numericality" by PMc</title>
      <description>There is some strangeness here:&lt;br /&gt;
1.&lt;br /&gt;
A not-equal operator is missing. I do not see the real sense in an equal operator - if there should be a predefined specific value for a field, then why open a field at all? But I see lot of sense in a non-equal operator, especially in each shopping system you do not want an item-count 0 entered.&lt;br /&gt;
2.&lt;br /&gt;
There is no longer checked against general numericality as soon as there is a comparison added. I do not see why an erroneous entry like maybe "19%0" should still be compared but not be detected as erroneous.&lt;br /&gt;
3.&lt;br /&gt;
If I request ":gte =&gt; 2.5" and enter 2.5, I still get an error. This is obvious from the code, as there is a conversion to_i done. I do not see why.&lt;br /&gt;
4.&lt;br /&gt;
As soon as one of the comparisons is used, the error message given by :message is no longer used, instead a static one from the plugin is used.&lt;br /&gt;
5. &lt;br /&gt;
I do not understand the code.</description>
      <pubDate>Thu, 22 Feb 2007 15:07:16 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:06755bf3-130e-406e-8176-4826cf1fb561</guid>
      <link>http://i.nfectio.us/articles/2006/01/27/defining-numericality#comment-265</link>
    </item>
    <item>
      <title>"Testing Gotchas in Rails" by matt</title>
      <description>I most often run my tests seperatly, during development, so I experience this problem from the other direction.  Loading up the fixtures returns the db to an expected state that tests depend on.  What ends up happening when you forget to include the fixtures is that an earlier test will run, loading up the db and manipulating the records, then when it gets to the next test, the db isn't in expected state, so the test fails.  

Yea, first time, it was really confusing why individual tests passed, but the entire test suite failed.</description>
      <pubDate>Thu, 22 Feb 2007 11:15:39 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:8616fcf2-d813-49f3-bd87-0b883c04d511</guid>
      <link>http://i.nfectio.us/articles/2006/10/09/testing-gotchas-in-rails#comment-264</link>
    </item>
  </channel>
</rss>
