<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>AHG Software - Home</title>
  <id>tag:www.ahgsoftware.com,2008:mephisto/</id>
  <generator version="0.7.3" uri="http://mephistoblog.com">Mephisto Noh-Varr</generator>
  <link href="http://www.ahgsoftware.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://www.ahgsoftware.com/" rel="alternate" type="text/html"/>
  <updated>2008-05-11T18:58:43Z</updated>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:www.ahgsoftware.com,2008-05-11:188</id>
    <published>2008-05-11T18:48:00Z</published>
    <updated>2008-05-11T18:58:43Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2008/5/11/existence-assertion-for-named-scopes" rel="alternate" type="text/html"/>
    <title>Existence Assertion for Named Scopes</title>
<content type="html">
            &lt;p&gt;Forgive the overblown title, just leaving myself a quick note...&lt;/p&gt;

&lt;pre&gt;
ActiveRecord::Base.metaclass.class_eval do
  def named_scope_with_existence_assertion(*args)
    named_scope_without_existence_assertion(*args)
    define_method(&quot;#{scope_name = args.first}?&quot;){self.class.send(scope_name).exists?(id)}
  end
  alias_method_chain :named_scope, :existence_assertion
end
&lt;/pre&gt;

&lt;p&gt;Usage:
&lt;pre&gt;
class Item &amp;lt; ActiveRecord::Base
  named_scope :featured, :conditions =&gt; {:featured =&gt; true}
end

# obviously, this works...
Item.featured.find :all

# and now we get
Item.find(:first).featured? # does this instance satisfy the scope conditions?
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;Thanks for the idea, &lt;a href=&quot;http://www.brendanbaldwin.com&quot;&gt;BB&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:www.ahgsoftware.com,2008-02-15:89</id>
    <published>2008-02-15T04:00:00Z</published>
    <updated>2008-02-15T04:05:48Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2008/2/15/niu-shooting" rel="alternate" type="text/html"/>
    <title>NIU Shooting</title>
<content type="html">
            I've been gone from NIU for years now (pretty much as long as I've had children), yet, I must say that all of this press coverage about the shooting is terrifying. I learned C/C++ in that damn Cole Hall. My friends and I had Unix together there, and assembly, and various other classes. Somehow, Virginia Tech was a million miles away, but, this is so close to home.  Its all so lame, there is nothing to be learned from crap like this. Its just senseless. Bogus * 10 ^ 23.
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-12-12:74</id>
    <published>2007-12-12T22:33:00Z</published>
    <updated>2007-12-12T22:39:00Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/12/12/words-of-the-day-for-google" rel="alternate" type="text/html"/>
    <title>Words of the Day for Google</title>
<content type="html">
            &lt;p&gt;Recently, I blurted out some words at work that sounded unique. Indeed, Google search results proved their uniqueness. Here, I present you with my never-heard-in-our-hemisphere bits to add to your vocabulary...&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;HamShagger&lt;/li&gt;
&lt;li&gt;TinderPost&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use them sparingly, but effectively.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-11-17:70</id>
    <published>2007-11-17T18:25:00Z</published>
    <updated>2007-11-17T20:23:41Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/11/17/tech-cocktail-chicago-2007" rel="alternate" type="text/html"/>
    <title>TECH Cocktail Chicago 2007</title>
<content type="html">
            &lt;p&gt;I won't blab too much about this years TECH Cocktail in Wrigleyville, other than to say that it was oddly fun. Free drinks, overly enthusiastic entrepeneurs, and even some slimeball journalists contributed to an already exciting event. My ThePoint.com bandmates (Ken, Jim, and the bossman Andrew) made our rounds, met some people, and ran into familiar faces. Sadly, I took a lone picture, but, here's proof that not only is &lt;a href=&quot;http://shanesbrain.net/&quot;&gt;Shane Vitarana&lt;/a&gt; a great developer, he also knows how to get down.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://www.ahgsoftware.com/assets/2007/11/17/IMG_0041.JPG&quot; width=&quot;350&quot; /&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-11-06:69</id>
    <published>2007-11-06T05:25:00Z</published>
    <updated>2007-11-06T05:51:12Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/11/6/el-punto" rel="alternate" type="text/html"/>
    <title>El Punto</title>
<content type="html">
            &lt;p&gt;For anyone wondering if I had been abducted by aliens.. Yes.  Anyway, I've been holed up at ThePoint.com working my ass off to get us closer to launch. Although there is a ton left to do,  just be aware that I'm committed to getting the ball rolling there, so please forgive my lack of communication in the mean time!&lt;/p&gt;

&lt;p&gt;Also, my other dirty little secret is that I'm busy preparing 3-4 of my songs for recording next month. Craig Martinez will do the drums. My chops need alot of work before I go in there!. I'll post a pre-recording demo for you to check out.

&amp;lt;embed pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; type=&quot;application/x-shockwave-flash&quot; src=&quot;http://www.odeo.com/flash/audio_player_standard_gray.swf&quot; flashvars=&quot;valid_sample_rate=true&amp;external_url=http://www.ahgsoftware.com/assets/2007/11/6/El_Gunto_MP3.mp3&quot; allowscriptaccess=&quot;always&quot; height=&quot;52&quot; wmode=&quot;transparent&quot; quality=&quot;high&quot; width=&quot;300&quot;&gt; &amp;lt;/embed&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>mcerna</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-10-09:28</id>
    <published>2007-10-09T07:55:12Z</published>
    <updated>2007-10-10T02:05:44Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/10/9/little-nugget-of-email-happiness" rel="alternate" type="text/html"/>
    <title>Little Nugget of Email Happiness</title>
<content type="html">
            &lt;p&gt;I check my Yahoo mail about 86399 times a day. I&#8217;m also an avid Safari user (FF has become morbidly obese &lt;span class=&quot;caps&quot;&gt;IMO&lt;/span&gt;). The fact that I haven&#8217;t been able to use the Yahoo Beta Mail client has been a sore spot with me for quite a while. I woke up today, checked my mail, and now it just plain works! Fan-!@#$-ing-tastic. Rails 1.2.4 a few days ago, Mac Leopard in a few weeks, iPhone hackery/de-brickification&#8230;. Its good to be a geek.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>mcerna</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-04-30:27</id>
    <published>2007-04-30T16:02:29Z</published>
    <updated>2007-10-10T02:05:43Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/4/30/capistrano-2-0-preview-with-http-auth" rel="alternate" type="text/html"/>
    <title>Capistrano 2.0 preview with HTTP Auth</title>
<content type="html">
            &lt;p&gt;If you&#8217;re migrating a Capistrano1.x site, over to Capistrano 2, and your &lt;span class=&quot;caps&quot;&gt;SVN&lt;/span&gt; repository happens to be behind &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; authentication, then you probably already know about using this..&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;set &lt;span class=&quot;sy&quot;&gt;:svn_username&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:svn_password&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;When you switch to Capistrano 2, make sure that you change those :svn_ arguments to :scm_*, eg..&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;set &lt;span class=&quot;sy&quot;&gt;:scm_username&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:scm_password&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


&lt;p&gt;Happy Deployment!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>mcerna</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-04-15:26</id>
    <published>2007-04-15T09:16:18Z</published>
    <updated>2007-10-10T02:05:43Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/4/15/simpleobject-update" rel="alternate" type="text/html"/>
    <title>SimpleObject Update</title>
<content type="html">
            &lt;p&gt;I haven&#8217;t had the time to set my svn up to be multi-contributor safe (permissions are a pain in the ass, plus, some of the people that I host are massive targets for hackers/attacks). However, I did update SimpleObject with some fantastic auto-sensing mime-type code, contributed by Mark Kufner over at &lt;a href=&quot;http://www.kufnerfutures.com&quot;&gt;Kufner Futures&lt;/a&gt;. Their product is insanely awesome looking, I wanna get one when I move downtown to Chicago.&lt;/p&gt;

&lt;p&gt;Speaking of Chicago, I have failed to mention that I work for a great startup downtown. It should turn out to be a fun experience, as I really believe in the product (which shall remain anonymous until its launch). The good thing is, although it might not be as much $$$ as doing the 24-7 contracts that I have been for the last 2 years, the piece of mind of being an employee and getting a monothilic check, having my opinion respected by other developers (instead of those that can&#8217;t do a HelloWorld in our chosen language), and working with a bunch of great developers/dudes is fantastic. Between, &lt;a href=&quot;http://www.affiliates.thinkhost.com/checkin.php?refid=11059&#38;bid=174&#38;pt=rc&quot;&gt;Thinkhost&lt;/a&gt;, this job, and Will at &lt;a href=&quot;http://www.highend3d.com&quot;&gt;Highend3d&lt;/a&gt;, I have the best group of people I could possibly ask to work with. Anyway, sappy ranting aside, I&#8217;m commuting around 4 hours a day, making my 8hour job a 12 hour excursion, which is &lt;span class=&quot;caps&quot;&gt;KILLING&lt;/span&gt; me!!! So, as soon as I get my next payment from basically anyone, I&#8217;m moving my happy ass downtown into a killer condo, or a nice loft. Hell, I&#8217;d even rent a house, having kids might mandate such a choice.&lt;/p&gt;

&lt;p&gt;The last of my personal updates&#8230; My solo album is gearin&#8217; up for a recording. I&#8217;m busy charting out my songs so that my drummer/keyboardists can fill in the parts. The only sucky thing is that I wrote these tunes over the course of the last 15 years, and many of them are interesting but lacking in the harmonic/motific development of which I can produce currently. So, I wasn&#8217;t prepared to delve back in and start working on all of them, but, hell, I better. I do believe I have &lt;span class=&quot;caps&quot;&gt;WAY&lt;/span&gt; more to contribute to the music world, than I do the programming world, even though I love both nearly equally. The time of reckoning draws nigh, peeps. Peace out!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>mcerna</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-03-18:25</id>
    <published>2007-03-18T21:59:49Z</published>
    <updated>2007-10-10T02:05:43Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/3/18/how-to-encrypt-ruby-on-rails-mail-with-gnupg" rel="alternate" type="text/html"/>
    <title>How-to Encrypt Ruby on Rails Mail with GnuPG</title>
<content type="html">
            &lt;p&gt;&lt;span class=&quot;caps&quot;&gt;DRY&lt;/span&gt; is a great concept. As one of philosophies upon which Rails is established, Do-Not-Repeat-Yourself is a mantra that is starting to become ever-pervasive in my coding as well as my daily work ethic. So, with that in mind, I&#8217;ve decided to &lt;span class=&quot;caps&quot;&gt;NOT&lt;/span&gt; respond to the latest email inquiry about how to Encrypt your outgoing email messages from your Rails applications, and just write up a quick tutorial.&lt;/p&gt;

&lt;p&gt;I use my &lt;a href=&quot;/pages/gnupg&quot;&gt;GnuPG plugin&lt;/a&gt; mainly for e-commerce applications, where secure credit-card storage opens many &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; integration possibilities with the myriad of Merchant-processor options that are available. It works just as well for any data that necessitates two-way encryption. Lets say you whip up a quick formmail action in rails that emails you live credit card information or top-secret addresses, you&#8217;ll wanna provide the rails application with your public key (to properly encrypt the message). Here&#8217;s a super-brief overview on how you can do it.&lt;/p&gt;

&lt;h3&gt;Step 1: Install the plugin&lt;/h3&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;ruby script/plugin install svn&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;/ahgsoftware.com/gnupg/trunk&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


&lt;h3&gt;Step 2: Generate a mailer&lt;/h3&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;ruby script/generate mailer test_mailer hello_world&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;Now we&#8217;ve got a TestMailer object with a default hello_world action. Before you move on, remember to add a recipient to the &#8216;recipient&#8217; field in the model class (otherwise, our test will go nowhere!)&lt;/p&gt;

&lt;h3&gt;Step 3: Fire up the console&lt;/h3&gt;
&lt;p&gt;Lets run through the process of loading the gnupg plugin and encrypting a mailout from the console (you can apply this code in your controller at your own discretion).&lt;/p&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;5&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;## Load GnuPG and the public key of your choice&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;gnupg = &lt;span class=&quot;co&quot;&gt;GnuPG&lt;/span&gt;.new &lt;span class=&quot;sy&quot;&gt;:recipient&lt;/span&gt;=&amp;gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Key Recipient whomever it may be&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;gnupg.load_public_key &lt;span class=&quot;co&quot;&gt;File&lt;/span&gt;.read(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/path/to/pubkey.asc&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;## If its loaded, create the mail, encrypt, send&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; gnupg.public_key_loaded?&lt;tt&gt;
&lt;/tt&gt;        email = &lt;span class=&quot;co&quot;&gt;TestMailer&lt;/span&gt;::create_hello_world&lt;tt&gt;
&lt;/tt&gt;        email.body = gnupg.encrypt(email.body)&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;co&quot;&gt;TestMailer&lt;/span&gt;::deliver(email)&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;## You probably don't need this, but, for a test, might as well&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;gnupg.drop_public_key&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;That should be about it. I&#8217;ve used several other methods (including capturing the output buffer and encrypting multi-part mail messages) in a few production sites, and I can&#8217;t settle on which method I prefer or where even to place the GnuPG instantiation. Thats what we love about Rails though, a million ways to do anything, and most of them just flow from the code like natural language. I love being a Rubyist. Better than a being a PHPist (masochist?).&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>mcerna</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-03-14:24</id>
    <published>2007-03-14T01:12:45Z</published>
    <updated>2007-10-10T02:05:43Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/3/14/punbb-sdk-update" rel="alternate" type="text/html"/>
    <title>PunBB SDK Update</title>
<content type="html">
            &lt;p&gt;Aight kiddies, in response to a few concerned emails, I&#8217;ve changed the auto-login in the PunBB Plugin for Rails to directly log the user in via cookies/db instead of &lt;span class=&quot;caps&quot;&gt;AJAX&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;Just to refresh you on how this plugin is used..&lt;/p&gt;
&lt;h3&gt;Install your Rails app&lt;/h3&gt;
&lt;h3&gt;Install PunBB in the public dir (or even a subdir)&lt;/h3&gt;
&lt;h3&gt;Generate the login code with the punbb path&lt;/h3&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;./script/generate punbb_authentication account &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;forums&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;h3&gt;Email support@ahgsoftware.com when/if it blows up&lt;/h3&gt;

&lt;h3&gt;&lt;span class=&quot;caps&quot;&gt;JUST KIDDING&lt;/span&gt;, you&#8217;ll be fine&lt;/h3&gt;

&lt;p&gt;That command generates the skeleton files needed for login/logout. You &lt;span class=&quot;caps&quot;&gt;MUST&lt;/span&gt; specify a relative path to PunBB installation (e.g. /forums). All other variables are pulled from the config.php file via a neat regex (including the db table prefix, cookie name, etc). You krafty little koder peers of mine, might wanna check out that little regex scanner, you can use it to pull variables out of all kinds of config files (Wordpress, Joomla, etc).&lt;/p&gt;

&lt;p&gt;I really do agree with 99% of the principles that Rails and Dave&#8217;s pet project stand for, but, I am firmly in the camp that &lt;span class=&quot;caps&quot;&gt;HATES&lt;/span&gt; writing login code.  I&#8217;d say 2 out of 15 total large-scale Rails projects that I&#8217;ve designed have necessitated a highly targeted and advanced User engine. The rest have just needed a quick user db with a simple administration panel. Wordpress or PunBB work fantastically for this. Most of my wordpress + Rails integration code is buggy and not ready for primetime (and neither is my PunBB plugin, use at your own risk!), but, I do plan to release it soon. For now, happy posting!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>mcerna</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-03-12:23</id>
    <published>2007-03-12T00:55:00Z</published>
    <updated>2007-10-10T03:19:08Z</updated>
    <category term="Rails Plugins"/>
    <link href="http://www.ahgsoftware.com/articles/2007/3/12/punbb-sdk-for-ruby-on-rails" rel="alternate" type="text/html"/>
    <title>PunBB SDK for Ruby on Rails</title>
<content type="html">
            &lt;p&gt;After my last post about getting &lt;span class=&quot;caps&quot;&gt;IPB SDK&lt;/span&gt; working for the latest &lt;span class=&quot;caps&quot;&gt;IPB&lt;/span&gt; Release, I realized that, regardless of my dislike of forums as forums for online communication (PUN intended, shapap, double-entendre in yo face, mother!@#$%^), I have tons of code and projects that revolved around &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; Forums, and Rails backend applications.&lt;/p&gt;

&lt;p&gt;In keeping with my New Years Resolution of sharing those tidbits that make my life easier, here is a PunBB &lt;span class=&quot;caps&quot;&gt;SDK&lt;/span&gt;/Wrapper! It creates &lt;span class=&quot;caps&quot;&gt;ALL&lt;/span&gt; of the models needed for the punbb&#8217;s database objects, as well as a &lt;span class=&quot;caps&quot;&gt;VERY&lt;/span&gt; simple controller/views for auto-login capabilities.  The projects that I&#8217;ve used this on are very niche-oriented and don&#8217;t lend themselves to extracting much generic code. I can say, that a simple PunBB installation plus this generator can you have you running a fairly pimptastic site in no time! If you like forums, that is ;)&lt;/p&gt;

&lt;p&gt;To use it, install your rails app, install your &lt;a href=&quot;http://www.punbb.org/&quot;&gt;punbb&lt;/a&gt; installation, then grab the plugin&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;./script/plugin install svn&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;/ahgsoftware.com/punbb_sdk/trunk&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


&lt;p&gt;When developing a Rails application that requires at least &#8216;autologin&#8217; integration with a &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; forum application, I usually have to decide between several routes. 
&lt;ol&gt;&lt;strong&gt;The direct DB/cookie method&lt;/strong&gt;: You replicate the entire logic path of the forum system (PunBB/Vanilla &lt;span class=&quot;caps&quot;&gt;EASY&lt;/span&gt;, IPB not so much).&lt;/ol&gt;
&lt;ol&gt;&lt;strong&gt;By Proxy&lt;/strong&gt;: You use Net::HTTP, or libcurl, to submit the login form, intercept the cookie, and set the user&#8217;s browser cookies. This sucks, because some software makes the submitted variables jump through hoops of its own creation (&lt;strong&gt;cough&lt;/strong&gt;Joomla&lt;strong&gt;/cough&lt;/strong&gt;)&lt;/ol&gt;
&lt;ol&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;AJAX&lt;/span&gt;&lt;/strong&gt;: I am beginning to love this method, you just have your login form submit directly to your own software &lt;span class=&quot;caps&quot;&gt;AND&lt;/span&gt; to the forum application via some nifty ajax. This PunBB &lt;span class=&quot;caps&quot;&gt;SDK&lt;/span&gt; uses that particular technique&lt;/ol&gt;

&lt;p&gt;As far as forums go, PunBB is at the top of my list, because its developer friendly, and I just like the overall attitude that Rickard has over there! Consider donating to their cause  if you end up using this plugin (the cause of bringing a &lt;span class=&quot;caps&quot;&gt;SIMPLE&lt;/span&gt; forum to the world).&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>mcerna</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-03-06:22</id>
    <published>2007-03-06T22:24:11Z</published>
    <updated>2007-10-10T02:05:43Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/3/6/ipb-sdk-how-to-for-ipb-2-2" rel="alternate" type="text/html"/>
    <title>IPB SDK How-to for IPB 2.2</title>
<content type="html">
            &lt;/p&gt;After a slew of upgrades and massive internal reworking over at &lt;a href=&quot;http://www.highend3d.com&quot;&gt;Highend3d&lt;/a&gt;, Will and I decided to upgrade his Invision Power Board installation. Its been a few months since the latest Boards version 2.2 as well as &lt;span class=&quot;caps&quot;&gt;IPBSDK&lt;/span&gt;, so you&#8217;d think we were in the &#8216;safe zone&#8217;. &lt;span class=&quot;caps&quot;&gt;HECK NO&lt;/span&gt;! Ipbsdk threw a fit.  After gathering a few horror stories, I think I have a good idea of how to fix it, involving 2, possibly 3, steps!&lt;/p&gt;
&lt;p&gt;Our main file to edit..&lt;br /&gt;ipbsdk/ipbsdk_class.inc.php&lt;/p&gt;

&lt;h3&gt;Step 1: New Bootstrap Method&lt;/h3&gt;
&lt;p&gt;Right before the inclusion of the main &lt;span class=&quot;caps&quot;&gt;IPS&lt;/span&gt; file..
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;require_once ROOT_PATH   . &amp;quot;sources/ipsclass.php&amp;quot;;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

Add this line&lt;br /&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;require_once ROOT_PATH   . &amp;quot;init.php&amp;quot;;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;/p&gt;

&lt;h3&gt;Step 2: Instantiation&lt;/h3&gt;
&lt;p&gt;Previously, the basic instantiation of the ipbsdk libs could be done multiple times, e.g.
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;5&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;require_once &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ipbsdk/ipbsdk_class.inc.php&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;global &lt;span class=&quot;gv&quot;&gt;$SDK&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;gv&quot;&gt;$SDK&lt;/span&gt; =&amp;amp; new IPBSDK();&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;gv&quot;&gt;$SDK&lt;/span&gt;-&amp;gt;create_forum(....&lt;span class=&quot;er&quot;&gt;)&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;.... some code....&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;require_once &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ipbsdk/ipbsdk_class.inc.php&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;global &lt;span class=&quot;gv&quot;&gt;$SDK&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;gv&quot;&gt;$SDK&lt;/span&gt; =&amp;amp; new IPBSDK();&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;gv&quot;&gt;$SDK&lt;/span&gt;-&amp;gt;write_pm(....&lt;span class=&quot;er&quot;&gt;)&lt;/span&gt;;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


As of 2.2, the second instantiation of the &lt;span class=&quot;caps&quot;&gt;SDK&lt;/span&gt; classes will make the internal $SDK-&amp;gt;DB object just disappear. So, don&#8217;t liberally sprinkle &lt;br /&gt;$SDK =&#38; new &lt;acronym title=&quot;&quot;&gt;IPBSDK&lt;/acronym&gt;;&lt;br /&gt; 
commands all over the place. &lt;br /&gt;
If you see this error
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;Fatal&lt;/span&gt; error: &lt;span class=&quot;co&quot;&gt;Call&lt;/span&gt; to a member function on a non-object &lt;span class=&quot;r&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;tm/domains/public_html/forum/sources/handlers/han_parse_bbcode.php on line &lt;span class=&quot;i&quot;&gt;380&lt;/span&gt; &lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

then you are suffering from the aforementioned problem. BBcode seems rather unrelated, but, its cache-check method is one of the first places that a missing DB adapter manifests itself, hence the ubiquity of that error message!&lt;br /&gt;
At this point, most people&#8217;s boards should work just fine!
&lt;/p&gt;
&lt;h3&gt;Step 3 (Optional): Corrupt Group Data&lt;/h3&gt;
&lt;p&gt;We had some corrupt group/user data that would throw up &lt;span class=&quot;caps&quot;&gt;IPS DB&lt;/span&gt; Driver errors as well.  If you&#8217;re having issues, do a grep for &#8216;IN(&#8217; in the class file.

if you see a statement like..
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt; g_id IN(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.$info['mgroup_others'].&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

change it, so that &#8217;&#8217; occupies the parenthesis in case there is missing group data, i.e. (IN ()  is not valid, at least IN(&#8217;&#8217;) is needed).
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt; g_id IN(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;.(strlen($info['mgroup_others']) ? $info['mgroup_others'] : &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


&lt;/p&gt;

&lt;p&gt;I&#8217;m not a big fan of forum software in general. Its always big, bloated, ugly, and appeals to stats-whores of the worst kind (oh look, I have a shiny new counter for xxxx feature).  Digging through forums for a fix like this drives me nuts! Hopefully, being in a blog makes this more easily accessible for those of us that enjoy blogs! Converge, oh &lt;span class=&quot;caps&quot;&gt;IPB&lt;/span&gt; users, converge I say ;)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>mcerna</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-01-30:21</id>
    <published>2007-01-30T16:24:00Z</published>
    <updated>2007-10-30T18:11:12Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/1/30/os-x-mysql-gem-compilation-error" rel="alternate" type="text/html"/>
    <title>OS X MySQL Gem Compilation Error</title>
<content type="html">
            &lt;p&gt;Darwinports does some weird shtuff. I think its highly convenient, but I don&#8217;t have time to debug the myriad of issues that crop up from multiple ruby and mysql installations. So, I wiped my Darwinports /opt folder, and started anew, with native versions of everything.&lt;/p&gt;

&lt;p&gt;Since mysql&#8217;s header libs don&#8217;t include the proper type definitions to build the mysql gem, just add it to the mysql header, and the gem will compile just fine.&lt;/p&gt;

&lt;h3&gt;In /usr/local/mysql/include/mysql.h&lt;/h3&gt;
&lt;p&gt;Put this near the top, preferably after the redundancy-check in the preprocessor directives.&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;#define ulong unsigned long&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


&lt;p&gt;Then install the gem with the dependencies like so..&lt;/p&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;gem install mysql -- --with-mysql-config=&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;usr&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;local/mysql/bin/mysql_config&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


&lt;p&gt;Happy Compiling!&lt;/p&gt;

&lt;h3&gt;* Update&lt;/h3&gt;
&lt;p&gt;The Cat is out of the bag (Leopard) and a new set of issues has cropped up. Check out &lt;a href=&quot;http://trac.macosforge.org/projects/ruby/wiki/Troubleshooting&quot;&gt;this wiki&lt;/a&gt; for some very useful commands to install the mysql gem easily&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>mcerna</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-01-30:20</id>
    <published>2007-01-30T10:55:29Z</published>
    <updated>2007-10-10T02:05:43Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/1/30/back-to-software" rel="alternate" type="text/html"/>
    <title>Back to Software</title>
<content type="html">
            &lt;p&gt;Ok, that didn&#8217;t last very long. After amassing a list of musical rants, and ideas for the musical portion of my site, I decided, the scope of it all is far too large for a development site! Anyway, I have some big-ticket software/support packages coming up, for interested parties. I&#8217;ll make info available shortly!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.ahgsoftware.com/">
    <author>
      <name>mcerna</name>
    </author>
    <id>tag:www.ahgsoftware.com,2007-01-20:19</id>
    <published>2007-01-20T23:42:36Z</published>
    <updated>2007-10-10T02:05:42Z</updated>
    <link href="http://www.ahgsoftware.com/articles/2007/1/20/infant-plugin-what-the-heck" rel="alternate" type="text/html"/>
    <title>Infant Plugin, what the heck!</title>
<content type="html">
            &lt;p&gt;Someone actually searched for &#8220;Infant Plugins&#8221; and arrived at my site. The only thing scarier than someone searching for Infant Plugins, is &lt;span class=&quot;caps&quot;&gt;AHG&lt;/span&gt; Software being #2 on google for it. What the !#@$ is with that, I feel like I&#8217;ve joined some creepy society for god knows what.&lt;/p&gt;
          </content>  </entry>
</feed>
