<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Daniel Morrison - All Comments</title>
  <id>tag:daniel.collectiveidea.com,2008:mephisto/comments</id>
  <generator uri="http://mephistoblog.com" version="0.7.2">Mephisto Noh-Varr</generator>
  <link href="http://daniel.collectiveidea.com/blog/feed/all_comments.xml" rel="self" type="application/atom+xml"/>
  <link href="http://daniel.collectiveidea.com/blog/" rel="alternate" type="text/html"/>
  <updated>2008-05-09T06:13:35Z</updated>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>hgh</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2008-04-12:4231:4477</id>
    <published>2008-05-09T06:13:35Z</published>
    <updated>2008-05-09T06:13:35Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2008/4/12/git-submodules-part-2" rel="alternate" type="text/html"/>
    <title>Comment on 'Git Submodules, Part 2' by hgh</title>
<content type="html">&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;I LOVE GIT&lt;/span&gt;! Thanks for the awesome code!&lt;/p&gt;


	&lt;p&gt;Eddie &lt;span class=&quot;caps&quot;&gt;HGH&lt;/span&gt;&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>John-Paul Bader</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2008-04-12:4231:4296</id>
    <published>2008-04-19T10:11:37Z</published>
    <updated>2008-04-19T10:11:37Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2008/4/12/git-submodules-part-2" rel="alternate" type="text/html"/>
    <title>Comment on 'Git Submodules, Part 2' by John-Paul Bader</title>
<content type="html">&lt;p&gt;Sorry, wrong line number &#8211; its 526 in my verion &#8211; in the git hub version its 534&lt;/p&gt;


	&lt;p&gt;self.class.base_class.update_all(&#8221;#{left_column_name} = (#{left_column_name} &#8211; #{diff})&#8221;,&#8221;#{left_column_name} &amp;gt;= #{right}&#8221;)&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>John-Paul Bader</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2008-04-12:4231:4295</id>
    <published>2008-04-19T10:08:14Z</published>
    <updated>2008-04-19T10:08:14Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2008/4/12/git-submodules-part-2" rel="alternate" type="text/html"/>
    <title>Comment on 'Git Submodules, Part 2' by John-Paul Bader</title>
<content type="html">&lt;p&gt;Hey there &#8211; this comment is off topic and concerning your awesome nested set plugin which i have problems with. I&#8217;m using postgresql and it seems that &#8220;prune_from_tree&#8221; doesn&#8217;t work in postgres where the line 526 in awesome_nested_set.rb would generate this query:&lt;/p&gt;


	&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;UPDATE&lt;/span&gt; pages &lt;span class=&quot;caps&quot;&gt;SET&lt;/span&gt; lft = (lft &#8211; 2) &lt;span class=&quot;caps&quot;&gt;WHERE&lt;/span&gt; (lft &amp;gt;= 36)  &lt;span class=&quot;caps&quot;&gt;ORDER BY&lt;/span&gt; lft&lt;/p&gt;


	&lt;p&gt;which is incorrect syntax in Postgres. I was also wondering if the order statement is really neccessary at this particular part of the module. I couldn&#8217;t figure out where it comes from anyway because its not in line 526. Maybe you have the motivation to fix this for postgresql. Feel free to contact me via mail so I can give you more feedback in case you don&#8217;t ever use postgres.&lt;/p&gt;


	&lt;p&gt;Kind regards, John&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>Josh Merchant</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2007-02-08:52:4282</id>
    <published>2008-04-18T04:22:44Z</published>
    <updated>2008-04-18T04:22:44Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2007/2/8/rails-plugin-imap_authenticatable" rel="alternate" type="text/html"/>
    <title>Comment on 'Rails Plugin: imap_authenticatable' by Josh Merchant</title>
<content type="html">&lt;p&gt;Awesome idea. Great for pitching enterprise rails apps.&lt;/p&gt;


	&lt;p&gt;Added it to my project&#8230; however experienced some problems.&lt;/p&gt;


	&lt;p&gt;I don&#8217;t know how your particular &lt;span class=&quot;caps&quot;&gt;IMAP&lt;/span&gt; server responded to your request, however using a standard email one caused some issues. Even though the login credentials were right, it still seemed to return false.&lt;/p&gt;


	&lt;p&gt;Wasn&#8217;t a big deal to fix.. just thought you might be interested in the solution:&lt;/p&gt;


	&lt;p&gt;login = imap.authenticate(&#8216;LOGIN&#8217;, username, password)
if login[:name] == &#8216;OK&#8217;
   if imap_authenicatable_options[:allow_new_users]
      find_or_create_by_login(username)
   else
      find_by_login(username)
   end
else
   false
end
rescue
  false
ensure
 imap.disconnect&lt;/p&gt;


	&lt;p&gt;Works like a charm :-)&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>Ryan McGeary</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2008-04-12:4231:4235</id>
    <published>2008-04-13T00:03:44Z</published>
    <updated>2008-04-13T00:03:44Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2008/4/12/git-submodules-part-2" rel="alternate" type="text/html"/>
    <title>Comment on 'Git Submodules, Part 2' by Ryan McGeary</title>
<content type="html">&lt;p&gt;Daniel,  Thanks for taking the time on this detailed response.  Good info, especially on how submodules handle the commit revision.  I now have a better understanding of things which will help me make a more informed decision on my git repositories, especially since piston 2.0 isn&#8217;t ready yet, and braid currently has self-proclaimed warnings of being riddled with issues.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>Daniel Morrison</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2008-04-09:4214:4233</id>
    <published>2008-04-12T18:04:14Z</published>
    <updated>2008-04-12T18:04:14Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2008/4/9/git-submodules" rel="alternate" type="text/html"/>
    <title>Comment on 'Git Submodules' by Daniel Morrison</title>
<content type="html">&lt;p&gt;Good comments, Ryan. I &lt;a href=&quot;http://daniel.collectiveidea.com/blog/2008/4/12/git-submodules-part-2&quot;&gt;posted a follow-up&lt;/a&gt;.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>Ryan McGeary</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2008-04-09:4214:4229</id>
    <published>2008-04-12T13:58:45Z</published>
    <updated>2008-04-12T13:58:45Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2008/4/9/git-submodules" rel="alternate" type="text/html"/>
    <title>Comment on 'Git Submodules' by Ryan McGeary</title>
<content type="html">&lt;p&gt;Daniel, Good post, but isn&#8217;t there a small advantage to a piston or braid-like approach where all the files are in your own repository?  What happens during deployments?  Doesn&#8217;t the deployment now rely on a possible many remote repositories to succeed?  Consider both &lt;code&gt;vendor/rails&lt;/code&gt; and a possible many &lt;code&gt;vendor/plugins&lt;/code&gt; each with their own submodule.&lt;/p&gt;


	&lt;p&gt;I think I also missed an important point.  How does Matt&#8217;s &lt;code&gt;git submodule update&lt;/code&gt; avoid pulling a later version of edge rails than the original revision that you intended?  The .gitmodules file only seems to specify the public clone url without any commit revision.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>Daniel Morrison</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2008-04-09:4214:4217</id>
    <published>2008-04-10T03:58:17Z</published>
    <updated>2008-04-10T03:58:17Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2008/4/9/git-submodules" rel="alternate" type="text/html"/>
    <title>Comment on 'Git Submodules' by Daniel Morrison</title>
<content type="html">&lt;p&gt;Mark,&lt;/p&gt;


	&lt;p&gt;Good point. Maybe I&#8217;m too hard on svn, by only pointing to the common (non-version-specified) use case.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>Mark Van Holstyn</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2008-04-09:4214:4215</id>
    <published>2008-04-09T03:54:34Z</published>
    <updated>2008-04-09T03:54:34Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2008/4/9/git-submodules" rel="alternate" type="text/html"/>
    <title>Comment on 'Git Submodules' by Mark Van Holstyn</title>
<content type="html">&lt;p&gt;Thanks for the info on submodules Dan. Just a slight correction in regards to &lt;span class=&quot;caps&quot;&gt;SVN&lt;/span&gt; externals though. Externals do allow you to specify which revision you want to be tied to, for example:&lt;/p&gt;


	&lt;p&gt;rails -r9243 http://svn.rubyonrails.org/rails/trunk&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>adi</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2008-04-05:4204:4205</id>
    <published>2008-04-05T20:34:03Z</published>
    <updated>2008-04-05T20:34:03Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2008/4/5/css-naked-day-2008" rel="alternate" type="text/html"/>
    <title>Comment on 'CSS Naked Day 2008' by adi</title>
<content type="html">&lt;p&gt;Cool.. I will get 2 or even 3 of my sites nude&#8230;&lt;/p&gt;


	&lt;p&gt;Why we do not create Image Naked day also :) ?&lt;/p&gt;


	&lt;p&gt;Thanks&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>Sam Straw</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2008-04-01:4174:4188</id>
    <published>2008-04-03T05:27:55Z</published>
    <updated>2008-04-03T05:27:55Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2008/4/1/microreviews" rel="alternate" type="text/html"/>
    <title>Comment on 'MicroReviews' by Sam Straw</title>
<content type="html">&lt;p&gt;I always wondering why people use domains with WS as tld :), this is the first time i found this &lt;span class=&quot;caps&quot;&gt;TLD&lt;/span&gt; useful :)&lt;/p&gt;


	&lt;p&gt;Good luck!
Sam Straw&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>Dan Parker</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2007-05-17:285:4076</id>
    <published>2008-03-22T01:23:45Z</published>
    <updated>2008-03-22T01:23:45Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2007/5/17/the-road-to-randomness" rel="alternate" type="text/html"/>
    <title>Comment on 'The Road to Randomness' by Dan Parker</title>
<content type="html">&lt;p&gt;I know &lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; does a lot of math quite happily too &#8211; there should be a way to create a query that has a mathematical algorithm centered around random() that can do it quite efficiently. Thinking out loud here as I research&#8230;&lt;/p&gt;


	&lt;p&gt;For starters, you can use &#8220;&lt;acronym title=&quot;20+(RAND(&quot;&gt;FLOOR&lt;/acronym&gt;&lt;strong&gt;180))&#8221; to get a random integer between 20 and 200. If you can assume that most numbers exist in your id&#8217;s, you could grab a random match: &#8220;id IN (&lt;acronym title=&quot;20+(RAND(&quot;&gt;FLOOR&lt;/acronym&gt;&lt;/strong&gt;highest_id_in_table)))&#8221;.&lt;/p&gt;


	&lt;p&gt;Now, you&#8217;d need to gather that highest_id_in_table. The following is a start:&lt;/p&gt;


	&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SELECT&lt;/span&gt; * &lt;span class=&quot;caps&quot;&gt;FROM&lt;/span&gt; logs &lt;span class=&quot;caps&quot;&gt;WHERE&lt;/span&gt; id IN (&lt;acronym title=&quot;1+(RAND(&quot;&gt;FLOOR&lt;/acronym&gt;&lt;strong&gt;(@highest := (SELECT &lt;acronym title=&quot;id&quot;&gt;MAX&lt;/acronym&gt; &lt;span class=&quot;caps&quot;&gt;FROM&lt;/span&gt; logs)))), &lt;acronym title=&quot;1+(RAND(&quot;&gt;FLOOR&lt;/acronym&gt;&lt;/strong&gt;@highest)));&lt;/p&gt;


	&lt;p&gt;&lt;del&gt;- but I&#8217;m not sure if it&#8217;s executing the (SELECT &lt;acronym title=&quot;id&quot;&gt;MAX&lt;/acronym&gt; &lt;span class=&quot;caps&quot;&gt;FROM&lt;/span&gt; logs) every time it compares a record, or not. With just a little more work (I have to go now, the evening activity is calling :P), you could get the @highest (a client variable in sql) to set only if it hasn&#8217;t been set yet. In any case, it gets carried over the rest of the equation. In fact, if you run that query, you&#8217;ll see very random results -&lt;/del&gt; on a table of over 3000 records, I got anywhere from 0 to 5 records returned. That was some good learning, anyway.&lt;/p&gt;


	&lt;p&gt;My real suggestion is to run two queries:
1) top = &lt;span class=&quot;caps&quot;&gt;SELECT&lt;/span&gt; &lt;acronym title=&quot;id&quot;&gt;MAX&lt;/acronym&gt; as top &lt;span class=&quot;caps&quot;&gt;FROM&lt;/span&gt; logs; #not a big overhead on an indexed integer column
2) Gather 6 random ruby bits: r = [rand(top),rand(top),...]
3) records = [&#8220;SELECT * &lt;span class=&quot;caps&quot;&gt;FROM&lt;/span&gt; logs &lt;span class=&quot;caps&quot;&gt;WHERE&lt;/span&gt; id IN (?) &lt;span class=&quot;caps&quot;&gt;GROUP BY&lt;/span&gt; id &lt;span class=&quot;caps&quot;&gt;LIMIT 3&lt;/span&gt;&#8221;, r]&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>Daniel Morrison</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2007-07-10:396:4059</id>
    <published>2008-03-20T22:59:03Z</published>
    <updated>2008-03-20T22:59:03Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2007/7/10/a-prettier-truncate-helper" rel="alternate" type="text/html"/>
    <title>Comment on 'A prettier truncate helper' by Daniel Morrison</title>
<content type="html">&lt;p&gt;Joe:&lt;/p&gt;


	&lt;p&gt;Yes, that&#8217;s because the regexp is specifically looking for word characters (\w).  I guess I could refactor it to look for spaces instead, but I don&#8217;t have that immediate need.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>Joe Van Dyk</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2007-07-10:396:4048</id>
    <published>2008-03-20T07:12:24Z</published>
    <updated>2008-03-20T07:12:24Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2007/7/10/a-prettier-truncate-helper" rel="alternate" type="text/html"/>
    <title>Comment on 'A prettier truncate helper' by Joe Van Dyk</title>
<content type="html">&lt;p&gt;Hm, it seems to fail if the text is all symbols (and no letters).&lt;/p&gt;


	&lt;p&gt;Try that function with this text:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.(&amp;gt; ^.( O_o)&amp;gt;&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Seems to fail for me on my site.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://daniel.collectiveidea.com/blog/">
    <author>
      <name>Eddie</name>
    </author>
    <id>tag:daniel.collectiveidea.com,2007-04-02:93:4007</id>
    <published>2008-03-15T00:56:21Z</published>
    <updated>2008-03-15T00:56:21Z</updated>
    <link href="http://daniel.collectiveidea.com/blog/2007/4/2/css-naked-day" rel="alternate" type="text/html"/>
    <title>Comment on 'CSS Naked Day' by Eddie</title>
<content type="html">&lt;p&gt;Awesome plugin.. I found it from Dustin page..&lt;/p&gt;


	&lt;p&gt;Thanks!&lt;/p&gt;</content>  </entry>
</feed>
