Nick Sieger: Category java tag:blog.nicksieger.com,2005:Typo Typo 2010-11-22T19:09:47+00:00 Nick Sieger urn:uuid:698d3238-c164-45fd-a7c4-0c07199a71df 2006-06-26T17:53:00+00:00 2010-11-22T19:09:47+00:00 ActiveRecord JDBC adapter as Rails plugin <p>I&#8217;ve got things set up in my svn repo such that you pull down my ActiveRecord JDBC adapter as a Rails plugin&#46; Although it appears that using &#8216;script/plugin&#8217; inside of JRuby may have some issues&#46; So for now, use C Ruby&#46; Inside your Rails app, do:</p> <div class="typocode"><pre><code class="typocode_default ">ruby script/plugin install http://svn.caldersphere.net/svn/main/activerecord-jdbc/trunk/activerecord_jdbc/</code></pre></div> <p>This should pull down and configure the JDBC adapter for you with no additional setup&#46; If it doesn&#8217;t, let me know and we&#8217;ll work through it&#46; I haven&#8217;t yet tried running a Rails app inside of JRuby yet but I hope to in the next couple of days&#46;</p> <p>I am also starting to investigate testing with another database, hsqldb&#46; I think the driver could benefit from attempting to use some additional databases, if we&#8217;re ever going to fulfill the promise of leveraging any JDBC data source, and also I think it would be cool to use an embedded database in the spirit of SQLite which has become popular with smaller Rails apps in C Ruby&#45;based Rails land&#46;</p> <p><em>Update:</em> it turns out you can&#8217;t easily install a new ActiveRecord adapter as a Rails plugin at this point with out some extra finagling, because of the way <code>Rails::Initializer</code> initializes the database before any of the plugins&#46; For now, I&#8217;ve got the plugin set up to re&#45;initialize all of the ActiveRecord infrastructure, so in order to use the JDBC adapter plugin, you&#8217;ll need to add the following to your <code>config/environment.rb</code>&#46; Note that you&#8217;re not &#8220;skipping&#8221; ActiveRecord, just initializing it later&#46;</p> <div class="typocode"><pre><code class="typocode_ruby "> <span class="comment"># Skip frameworks you're not going to use</span> <span class="ident">config</span><span class="punct">.</span><span class="ident">frameworks</span> <span class="punct">-=</span> <span class="punct">[</span><span class="symbol">:active_record</span><span class="punct">]</span></code></pre></div> Nick Sieger urn:uuid:a41e4385-8403-4baf-b382-bff2382ece22 2006-07-27T14:57:00+00:00 2010-11-22T20:58:52+00:00 Why does an array index start at 0, not 1 <p>If you were looking for an answer to this question, you apparently cannot get a straight one in the <a href="http://forum.java.sun.com/thread.jspa?threadID=357877&amp;start=0&amp;tstart=0">java forums</a>&#46; Just one of many choice quotes:</p> <blockquote> <blockquote> <p>Anyway, any logically counting would start at 0&#46;</p> </blockquote> <p>I tried that once&#46; I referred to my son as &#8220;Number Zero Son&#8221;&#46; Got a definitely negative response&#46;</p> </blockquote> Nick Sieger urn:uuid:eea101ac-a937-4482-b25c-5c2286f01f6d 2006-09-08T15:11:00+00:00 2010-11-22T18:35:26+00:00 JRuby and Sun <p>The noise <a href="http://www.bloglines.com/search?q=jruby&amp;ql=en&amp;s=f&amp;pop=l&amp;news=m">is</a> <a href="http://technorati.com/search/jruby">deafening</a> by now, but I&#8217;m feeling the desire to chime in publicly with my congratulations and support for <a href="http://headius.blogspot.com/2006/09/jruby-steps-into-sun.html">Charlie</a> and <a href="http://www.bloglines.com/blog/ThomasEEnebo?id=19">Tom</a>&#46; JRuby has come a long way in the past six months, and this is strong validation of that fact&#46;</p> <p>As I <a href="/articles/2006/05/15/jruby-on-rails-and-activerecord-on-jdbc">hinted back in May</a>, this is getting big, and it&#8217;s been a pleasure to have been on the JRuby train! The future is bright for Ruby and Java the platform, and JRuby is leading the way&#46;</p> Nick Sieger urn:uuid:be1363d9-dfe0-443e-8248-93aa31622820 2007-09-14T05:33:00+00:00 2010-11-22T18:07:00+00:00 Gig: Speaking at RailsConf Europe 2007 <p>Speaking of keeping busy, <a href="http://www.railsconfeurope.com/cs/railseurope2007/view/e_sess/14961">I&#8217;ll be speaking</a> alongside my colleague <a href="http://blogs.sun.com/craigmcc/" title="Craig McClanahan's Weblog">Craig McClanahan</a> at <a href="http://www.railsconfeurope.com/" title="RailsConf Europe 2007 &#8226; September 17, 2007 - September 19, 2007 &#8226; Berlin, Germany">RailsConf Europe </a> in Berlin next week&#46;</p> <p>Sun is a Diamond Sponsor at RailsConf again, just like in Portland last May&#46; Part of that sponsorship money pays for a brief keynote spot (filled by Craig) as well as a session or two&#46; So no, I didn&#8217;t get my spot through an accepted proposal submission, but that doesn&#8217;t mean that the session is going to be a big <a href="http://headius.blogspot.com/2007/09/infoworld-bossies-close-to-my-heart.html">marketing shill</a>&#46;</p> <p>No, actually Craig and I are part of a small group at Sun that&#8217;s embracing Rails in a big way, and we&#8217;re going to be launching a site built mostly on Rails later this fall&#46; We&#8217;re taking what we think are some novel approaches to building a Rails&#45;based application and we thought we&#8217;d share some of those thoughts with you rather than drone on for the session about how great Sun is and what snazzy tools we make&#46; (Although expect to see a subtle plug or two for Sun hardware and tools&#46; Call it product placement rather than overt selling&#46;)</p> <p>I titled the session &#8220;Rails Hydra&#8221; because the central idea of the structure of our application is not one Rails app, but many&#46; The UI and views don&#8217;t even talk to a database; instead they make use of ActiveResource and RESTful web services, talking to the models living in other Rails applications in the backend&#46; One key point is we&#8217;re deploying &#46;war files to JRuby running on Glassfish, thus avoiding headaches of morbidly multiplying Mongrel math&#46; We&#8217;ll elaborate on this arrangement and talk about some of the other tools and tricks we&#8217;re using&#46;</p> <p>Also, Charlie, Tom and Ola will be there, so we&#8217;ll certainly have a JRuby summit at some point&#46; Stop by and say hello!</p>