<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>antiarc.net</title>
	<link>http://blog.antiarc.net</link>
	<description>Tech, gaming, social networking, and life in general</description>
	<pubDate>Fri, 07 Dec 2007 20:03:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.3</generator>
	<language>en</language>
			<item>
		<title>Automatic counter_cache maintenance.</title>
		<link>http://blog.antiarc.net/2007/12/07/automatic-counter_cache-maintenance/</link>
		<comments>http://blog.antiarc.net/2007/12/07/automatic-counter_cache-maintenance/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 19:55:14 +0000</pubDate>
		<dc:creator>Chris Heald</dc:creator>
		
		<category><![CDATA[Ruby/Rails]]></category>

		<guid isPermaLink="false">http://blog.antiarc.net/2007/12/07/automatic-counter_cache-maintenance/</guid>
		<description><![CDATA[I upgraded to Rails 2.0 today, and found that countercache columns were suddenly :readonly, which means that you can&#8217;t update them with your regular old model.associationcount = model.association.count routine. So, I whipped up the following ActiveRecord patch.


    module TagTeamInteractive
        module ActiveRecordSynchCounters
     [...]]]></description>
			<content:encoded><![CDATA[<p>I upgraded to Rails 2.0 today, and found that <code>counter<em>cache</code> columns were suddenly :readonly, which means that you can&#8217;t update them with your regular old model.association</em>count = model.association.count routine. So, I whipped up the following ActiveRecord patch.</p>

<p><code>
    module TagTeamInteractive
        module ActiveRecordSynchCounters
            def self.included(base)
                base.extend(ClassMethods)
            end</p>

<pre><code>        module ClassMethods
            def synch_all_counters!             
                self.find(:all).each do |u|
                    u.synch_counters!
                end
            end
        end         

        module InstanceMethods
            def synch_counters!
                fields = {}
                self.attributes.each do |k, v|                  
                    if k.match /_count$/ then
                        begin
                            f = k.gsub(/_count$/, "")
                            assoc = self.class.reflect_on_association(f.to_sym)
                            if assoc.macro == :has_many then
                                fields[f.to_sym] = self.send(f.to_sym).count - v
                            else
                                next
                            end
                        rescue
                            next
                        end
                    end
                end
                self.class.update_counters(id, fields) unless fields.empty?
            end
        end
    end
end

ActiveRecord::Base.send(:include, TagTeamInteractive::ActiveRecordSynchCounters)
ActiveRecord::Base.send(:include, TagTeamInteractive::ActiveRecordSynchCounters::InstanceMethods)   
</code></pre>

<p></code></p>

<p>Easy enough. Load that in your environment.rb, and then you can use the following: </p>

<p><code>
    Dir.glob("#{RAILS<em>ROOT}/app/models/*.rb&#8221;).each do |file|
        m = File.basename(file).split(&#8221;.&#8221;).first.camelize.constantize
        synch</em>all<em>counters! if m.is</em>a? ActiveRecord::Base
    end
</code></p>

<p>That&#8217;ll run synch<em>all</em>counters! for each record on each model in your database. Instant counter re-synching across the entire database. Tada!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.antiarc.net/2007/12/07/automatic-counter_cache-maintenance/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Measuring KLH Threat Meter&#8217;s impact on system performance</title>
		<link>http://blog.antiarc.net/2007/06/15/measuring-klh-threat-meters-impact-on-system-performance/</link>
		<comments>http://blog.antiarc.net/2007/06/15/measuring-klh-threat-meters-impact-on-system-performance/#comments</comments>
		<pubDate>Fri, 15 Jun 2007 21:15:01 +0000</pubDate>
		<dc:creator>Chris Heald</dc:creator>
		
		<category><![CDATA[Gaming]]></category>

		<category><![CDATA[World of Warcraft]]></category>

		<category><![CDATA[AddOns]]></category>

		<guid isPermaLink="false">http://blog.antiarc.net/2007/06/15/measuring-klh-threat-meters-impact-on-system-performance/</guid>
		<description><![CDATA[Script used:

Download it in AddOn form at http://wow.tachyonsix.com/GhettoFPSMonitor.zip



FPSProfiler = CreateFrame("Frame", "FPSProfiler", UIParent)
local runTime = 0
local fpsSum = 0
local fpsTicks = 0
local startTime = 0
local timeToRun = 0
local profilerLock = false

local function print(msg, ...)
    DEFAULT_CHAT_FRAME:AddMessage(string.format("&#124;cffffcc00GhettoFPSProfiler:&#124;r " .. msg, ...))
end

local function report()
    local endTime = GetTime()
    print("Profiling finished!")
 [...]]]></description>
			<content:encoded><![CDATA[<h3>Script used:</h3>

<p>Download it in AddOn form at <a href="http://wow.tachyonsix.com/GhettoFPSMonitor.zip">http://wow.tachyonsix.com/GhettoFPSMonitor.zip</a></p>

<p><code></p>

<pre><code>FPSProfiler = CreateFrame("Frame", "FPSProfiler", UIParent)
local runTime = 0
local fpsSum = 0
local fpsTicks = 0
local startTime = 0
local timeToRun = 0
local profilerLock = false

local function print(msg, ...)
    DEFAULT_CHAT_FRAME:AddMessage(string.format("|cffffcc00GhettoFPSProfiler:|r " .. msg, ...))
end

local function report()
    local endTime = GetTime()
    print("Profiling finished!")
    print("Total run time: %s", runTime)
    print("Total run time [GetTime() method]: %s", endTime - startTime)
    print("Total frames: %s", fpsTicks)
    print("Average framerate: %s", fpsSum / fpsTicks)
    profilerLock = false
    FPSProfiler:SetScript("OnUpdate", nil)
end

-- Runtime of doProfiling is O(n)
local function doProfiling()
    runTime = runTime + arg1
    fpsTicks = fpsTicks + 1
    fpsSum = fpsSum + GetFramerate()

    if runTime &gt; timeToRun then
        report()
    end
end

FPSProfiler.Start = function(runFor)
    if profilerLock then
        print("Profiling, can't start another profile.")
        return
    end
    profilerLock = true
    timeToRun = runFor

    runTime = 0
    fpsSum = 0
    fpsTicks = 0

    if _G.klhtm then
        print("Starting profiling, running for %s seconds, KTM is |cff00ff00enabled|r", runFor)
    else
        print("Starting profiling, running for %s seconds, KTM is |cffff0000not enabled|r", runFor)
    end
    startTime = GetTime()
    FPSProfiler:SetScript("OnUpdate", doProfiling)
end
</code></pre>

<p></code></p>

<h3>System Specs:</h3>

<ul>
<li>Athlon X2 3800+ Dual Core, 2.01GHz</li>
<li>2.0 GB DDR3200 RAM</li>
<li>BFGTech NVidia Geforce 7600GT, nv4_disp.dll driver: 6.14.0010.9371 (English)</li>
<li>Windows XP SP2, build 2600</li>
<li>AMD Cool &#8216;n Quiet driver not installed, Cool &#8216;n Quiet not enabled in the BIOS.</li>
</ul>

<h3>Process list:</h3>

<ul>
<li>calc.exe</li>
<li>taskmgr.exe</li>
<li>wmiprvse.exe</li>
<li>WoW.exe</li>
<li>TSVNCache.exe</li>
<li>Photoshop.exe</li>
<li>notepad++.exe</li>
<li>winamp.exe</li>
<li>firefox.exe</li>
<li>gain.exe</li>
<li>avnotify.exe</li>
<li>wuauclt.exe</li>
<li>svchost.exe</li>
<li>wscntfy.exe</li>
<li>cftmon.exe</li>
<li>jusched.exe</li>
<li>svnhost.exe</li>
<li>nvsvc32.exe</li>
<li>btwdins.exe</li>
<li>avguard.exe</li>
<li>sched.exe</li>
<li>spoolsv.exe</li>
<li>explorer.exe</li>
<li>avgnt.exe</li>
<li>lsass.exe</li>
<li>services.exe</li>
<li>winlogon.exe</li>
<li>csrss.exe</li>
<li>smss.exe</li>
<li>alt.exe</li>
</ul>

<h3>WoW Settings:</h3>

<ul>
<li>Resolution: 1680&#215;1050 (Wide), Windowed Fullscreen, running at 1920&#215;1200 native resolution</li>
<li>60hz refresh</li>
<li>24 bit color, 24 bit depth 2x multisample</li>
<li>Terrain distance: 60%</li>
<li>Environment detail: 50%</li>
<li>Anisotropic filtering: 0%</li>
<li>Terrain texture: 100%</li>
<li>Texture detail: 100%</li>
<li>Character Shadows: on</li>
<li>Spell Detail level: 100%</li>
<li>Weather Intensity: on</li>
<li>Level of Detail: off</li>
<li>All shaders checked</li>
<li>Trilinear filtering: off</li>
<li>Vertical sync: off</li>
<li>Triple buffering: off</li>
<li>Cinematic subtitles: off</li>
<li>Hardware cursor: on</li>
<li>Smooth mouse: off</li>
<li>CPU Profiling: Off</li>
</ul>

<p><a href='http://blog.antiarc.net/wp-content/uploads/2007/06/videooptions.jpg' title='Video options for KTM tests'><img src='http://blog.antiarc.net/wp-content/uploads/2007/06/videooptions.thumbnail.jpg' alt='Video options for KTM tests' /></a></p>

<p>Location: Azure Watch</p>

<h3>Addons running:</h3>

<ul>
<li>GhettoFPSMonitor</li>
<li>KLHThreatMeter v 19.18 (for test 2)</li>
</ul>

<h3>Testing methodlogy</h3>

<p>Game was loaded. A UI reload was invoked, and the UI was given at least 20 seconds to fully load and get all work out of the way and to enter an idle state. The profiler was invoked, and I physically got up from the computer and walked away to ensure that there would be no input that would incur additional overhead processing costs. There was additional rendering cost as players ran past my view, but they occurred in both tests.</p>

<p>This ensured that the tests occurred on a stripped-down, bare-bones, otherwise idle system with as many variables as possible held constant.</p>

<h3>15 sec run time:</h3>

<p>/script FPSProfiler.Start(15)</p>

<p>No KTM</p>

<ul>
<li>Run 1: 42.01</li>
<li>Run 2: 41.46</li>
<li>Run 3: 40.90</li>
<li>Run 4: 40.57</li>
</ul>

<p>Average: 41.24 FPS</p>

<p><a href='http://blog.antiarc.net/wp-content/uploads/2007/06/15secx4-noktm.jpg' title='15 sec run time with KTM disabled (repeated 4x)'><img src='http://blog.antiarc.net/wp-content/uploads/2007/06/15secx4-noktm.thumbnail.jpg' alt='15 sec run time with KTM disabled (repeated 4x)' /></a></p>

<p>KTM</p>

<ul>
<li>Run 1: 40.23</li>
<li>Run 2: 39.67</li>
<li>Run 3: 37.68</li>
<li>Run 4: 37.82</li>
</ul>

<p>Average: 38.85 FPS</p>

<p><a href='http://blog.antiarc.net/wp-content/uploads/2007/06/15secx4-ktm.jpg' title='15 sec run time with KTM enabled (repeated 4x)'><img src='http://blog.antiarc.net/wp-content/uploads/2007/06/15secx4-ktm.thumbnail.jpg' alt='15 sec run time with KTM enabled (repeated 4x)' /></a></p>

<p><b>Conclusion: Over a 15 second period, KTM degraded my overall system performance by 5.8%</b></p>

<h3>120 sec run time:</h3>

<p>/script FPSProfiler.Start(120)</p>

<p>No KTM</p>

<p>Run 1: 41.47</p>

<p><a href='http://blog.antiarc.net/wp-content/uploads/2007/06/120sec-noktm.jpg' title='120 sec run time with KTM disabled'><img src='http://blog.antiarc.net/wp-content/uploads/2007/06/120sec-noktm.thumbnail.jpg' alt='120 sec run time with KTM disabled' /></a></p>

<p>KTM
Run 1: 39.23</p>

<p><a href='http://blog.antiarc.net/wp-content/uploads/2007/06/120sec-ktm.jpg' title='120 sec run time with KTM enabled'><img src='http://blog.antiarc.net/wp-content/uploads/2007/06/120sec-ktm.thumbnail.jpg' alt='120 sec run time with KTM enabled' /></a></p>

<p><b>Conclusion: Over a 120 second period, KTM degraded my overall system performance by 5.5%</b></p>

<h2>Final notes</h2>

<p>10 tests is hardly conclusive (the one test each of the 120 sec cases is particularly incomplete), but I did it on a very short time budget, so more profiling may be done at a later date. I&#8217;ve included my entire setup here for anyone to replicate at will, and I am confident that it will produce similar results. </p>

<p>Edit: For grins and giggles, I went ahead and profiled Omen and ThreatLib under the same conditions.</p>

<p>Stock, 3 tests, 15 sec</p>

<ul>
<li>41.759 + 41.55 + 40.91 = 41.40</li>
</ul>

<p>Omem, 3 tests, 15 sec</p>

<ul>
<li>42.22 + 40.92 + 40.44 = 41.19</li>
</ul>

<p>Result: System performance while idle was reduced by 0.51% with Omen and ThreatLib versus a stock system, which is likely easily explained by the margin of error resulting from the low number of tests. I took screenshots, but I&#8217;m feeling lazy and anyone can replicate the tests as they see fit.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.antiarc.net/2007/06/15/measuring-klh-threat-meters-impact-on-system-performance/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SanityBags Beta 2 Release</title>
		<link>http://blog.antiarc.net/2007/05/03/sanitybags-beta-2-release/</link>
		<comments>http://blog.antiarc.net/2007/05/03/sanitybags-beta-2-release/#comments</comments>
		<pubDate>Thu, 03 May 2007 16:52:02 +0000</pubDate>
		<dc:creator>Chris Heald</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[Gaming]]></category>

		<category><![CDATA[World of Warcraft]]></category>

		<category><![CDATA[Lua]]></category>

		<category><![CDATA[Sanity]]></category>

		<category><![CDATA[SanityBags]]></category>

		<guid isPermaLink="false">http://blog.antiarc.net/2007/05/03/sanitybags-beta-2-release/</guid>
		<description><![CDATA[ I got my latest commit of SanityBags into SVN last night (at about&#8230;oh, 1:30 AM). It&#8217;s a massive overhaul of the whole system, and much more closely obeys the MVC design objectives now.

SanityBags is a virtual bags AddOn for World of Warcraft interfaces. I started writing it&#8230;oh, 5 months ago, and then got busy [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://blog.antiarc.net/wp-content/uploads/2007/05/sanitybags5.jpg' title='SanityBags Beta 1 screenshot'><img src='http://blog.antiarc.net/wp-content/uploads/2007/05/sanitybags5.thumbnail.jpg' alt='SanityBags Beta 1 screenshot' align="right" /></a> I got my latest commit of SanityBags into SVN last night (at about&#8230;oh, 1:30 AM). It&#8217;s a massive overhaul of the whole system, and much more closely obeys the MVC design objectives now.</p>

<p>SanityBags is a virtual bags AddOn for World of Warcraft interfaces. I started writing it&#8230;oh, 5 months ago, and then got busy and never actually finished it. It&#8217;s still unfinished, but it&#8217;s a lot further along now.</p>

<p><a href="http://blog.antiarc.net/2007/05/03/sanitybags-beta-2-release/#more-45" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.antiarc.net/2007/05/03/sanitybags-beta-2-release/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rubyinline rules.</title>
		<link>http://blog.antiarc.net/2007/05/02/rubyinline-rules/</link>
		<comments>http://blog.antiarc.net/2007/05/02/rubyinline-rules/#comments</comments>
		<pubDate>Wed, 02 May 2007 17:53:14 +0000</pubDate>
		<dc:creator>Chris Heald</dc:creator>
		
		<category><![CDATA[Ruby/Rails]]></category>

		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://blog.antiarc.net/2007/05/02/rubyinline-rules/</guid>
		<description><![CDATA[Yesterday, I discovered RubyInline. In short, it&#8217;s a gem that allows you to write Ruby extensions in C.

I decided to see what I could do with it.
]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I discovered <a href="http://www.zenspider.com/ZSS/Products/RubyInline/">RubyInline</a>. In short, it&#8217;s a gem that allows you to write Ruby extensions in C.</p>

<p>I decided to see what I could do with it.</p>

<p><a href="http://blog.antiarc.net/2007/05/02/rubyinline-rules/#more-43" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.antiarc.net/2007/05/02/rubyinline-rules/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introducing acts_as_fulltext_indexed</title>
		<link>http://blog.antiarc.net/2007/05/01/introducing-acts_as_fulltext_indexed/</link>
		<comments>http://blog.antiarc.net/2007/05/01/introducing-acts_as_fulltext_indexed/#comments</comments>
		<pubDate>Tue, 01 May 2007 16:22:02 +0000</pubDate>
		<dc:creator>Chris Heald</dc:creator>
		
		<category><![CDATA[Ruby/Rails]]></category>

		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.antiarc.net/2007/05/01/introducing-acts_as_fulltext_indexed/</guid>
		<description><![CDATA[My first Rails plugin is working! I won&#8217;t quite say finished, as it includes no formal tests or migrations, but I&#8217;ll get that packaged up in due time.

I recently found myself wanting to move my MySQL database from MyISAM tables to InnoDB tables. The primary reasons for this are:


InnoDB supports transactions
InnoDB supports row-level locking, as [...]]]></description>
			<content:encoded><![CDATA[<p>My first Rails plugin is working! I won&#8217;t quite say finished, as it includes no formal tests or migrations, but I&#8217;ll get that packaged up in due time.</p>

<p>I recently found myself wanting to move my MySQL database from MyISAM tables to InnoDB tables. The primary reasons for this are:</p>

<ol>
<li>InnoDB supports transactions</li>
<li>InnoDB supports row-level locking, as opposed to table-level locking</li>
<li>InnoDB supports foreign key constraints</li>
</ol>

<p>All very, very good things to have. Unfortunately, InnoDB does not support MyISAM&#8217;s FULLTEXT indexes. For those of you unfamiliar with <a href="http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html">MySQL&#8217;s fulltext searching</a>, it&#8217;s a really slick little piece of work, especially the <a href="http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html">boolean mode fulltext searches</a>. I wanted to have this functionality available across my database, but it seemed I couldn&#8217;t have my transactional, row-level constrained cake and search it, too.</p>

<p>Enter <code>acts_as_fulltext_indexed</code>.</p>

<p><a href="http://blog.antiarc.net/2007/05/01/introducing-acts_as_fulltext_indexed/#more-42" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.antiarc.net/2007/05/01/introducing-acts_as_fulltext_indexed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lightening load times with image concatenation</title>
		<link>http://blog.antiarc.net/2007/04/27/lightening-load-times-with-image-concatenation/</link>
		<comments>http://blog.antiarc.net/2007/04/27/lightening-load-times-with-image-concatenation/#comments</comments>
		<pubDate>Fri, 27 Apr 2007 08:26:38 +0000</pubDate>
		<dc:creator>Chris Heald</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://blog.antiarc.net/2007/04/27/lightening-load-times-with-image-concatenation/</guid>
		<description><![CDATA[BorkWeb has a good article about a relatively old and yet, underused image technique. It&#8217;s a good read, and certainly worth implementing where possible. I tend to use this technique with image rollovers, since you have &#8220;sets&#8221; of images that belong together.

It&#8217;s worth noting that this technique is very similar to sprite sheets used in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://borkweb.com">BorkWeb</a> has a <a href="http://borkweb.com/story/faster-page-loads-with-image-concatenation">good article</a> about a relatively old and yet, underused image technique. It&#8217;s a good read, and certainly worth implementing where possible. I tend to use this technique with image rollovers, since you have &#8220;sets&#8221; of images that belong together.</p>

<p>It&#8217;s worth noting that this technique is very similar to sprite sheets used in most 2D games, and UV-mapped texture maps used in 3D games. Rather than creating a separate resource for each frame of your sprite, or for each portion of a model you want to texture, you create one single resource for all the frames/textures, load it a single time, and then display portions of it as necessary. The benefits are the same in games and on the web - fewer resources to load means faster load times, and it&#8217;s cheaper to display two parts of one image than it is to display one part of two images.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.antiarc.net/2007/04/27/lightening-load-times-with-image-concatenation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Web 2.0 logos for dummies</title>
		<link>http://blog.antiarc.net/2007/04/24/web-20-logos-for-dummies/</link>
		<comments>http://blog.antiarc.net/2007/04/24/web-20-logos-for-dummies/#comments</comments>
		<pubDate>Tue, 24 Apr 2007 15:02:58 +0000</pubDate>
		<dc:creator>Chris Heald</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://blog.antiarc.net/2007/04/24/web-20-logos-for-dummies/</guid>
		<description><![CDATA[There are all these great logos out there for the so-called &#8220;Web 2.0&#8243; companies springing up every 15 minutes. How do they do it? It&#8217;s easier than you may think.

I&#8217;m going to show you how to create one of these logos in Photoshop in 5 minutes, or your money back. So fire up Photoshop, think [...]]]></description>
			<content:encoded><![CDATA[<p>There are all these great logos out there for the so-called &#8220;Web 2.0&#8243; companies springing up every 15 minutes. How do they do it? It&#8217;s easier than you may think.</p>

<p>I&#8217;m going to show you how to create one of these logos in Photoshop in 5 minutes, or your money back. So fire up Photoshop, think of a name, and let&#8217;s get cracking.</p>

<p><a href="http://blog.antiarc.net/2007/04/24/web-20-logos-for-dummies/#more-34" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.antiarc.net/2007/04/24/web-20-logos-for-dummies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dr. Nic&#8217;s Magic Models</title>
		<link>http://blog.antiarc.net/2007/04/24/dr-nics-magic-models/</link>
		<comments>http://blog.antiarc.net/2007/04/24/dr-nics-magic-models/#comments</comments>
		<pubDate>Tue, 24 Apr 2007 12:08:29 +0000</pubDate>
		<dc:creator>Chris Heald</dc:creator>
		
		<category><![CDATA[Ruby/Rails]]></category>

		<guid isPermaLink="false">http://blog.antiarc.net/2007/04/24/dr-nics-magic-models/</guid>
		<description><![CDATA[One of the annoying things about Rails is that it goes so far to connect pieces of the database together for you, but it doesn&#8217;t have the ability to automatically do validations or associations based on the schema data. A VARCHAR(30) NOT NULL is always going to need validates_length_of(:field, :in =&#62; 0..30), and validates_presence_of(:field), right? [...]]]></description>
			<content:encoded><![CDATA[<p>One of the annoying things about Rails is that it goes so far to connect pieces of the database together for you, but it doesn&#8217;t have the ability to automatically do validations or associations based on the schema data. A VARCHAR(30) NOT NULL is always going to need <code>validates_length_of(:field, :in =&gt; 0..30)</code>, and <code>validates_presence_of(:field)</code>, right? Or if you define a foreign key on a table, that&#8217;s an implied association that you&#8217;d have to set up in your model.</p>

<p><a href="http://magicmodels.rubyforge.org/">Dr. Nic&#8217;s Magic Models</a> provide just that. Based on the DB schema, the models will get automatic validations and associations, which I suspect would reduce the amount of code you have to write, and would result in both more complete Ruby code and better DB schemas.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.antiarc.net/2007/04/24/dr-nics-magic-models/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RJS minus R</title>
		<link>http://blog.antiarc.net/2007/04/24/rjs-minus-r/</link>
		<comments>http://blog.antiarc.net/2007/04/24/rjs-minus-r/#comments</comments>
		<pubDate>Tue, 24 Apr 2007 12:08:00 +0000</pubDate>
		<dc:creator>Chris Heald</dc:creator>
		
		<category><![CDATA[Ruby/Rails]]></category>

		<category><![CDATA[Javascript/AJAX]]></category>

		<guid isPermaLink="false">http://blog.antiarc.net/2007/04/24/rjs-minus-r/</guid>
		<description><![CDATA[RJS is a great little tool for interactively updating pieces of a page in response to some AJAX action, but it tends to fall short when you want to do anything beyond blinding dumping content into a page. Dan Webb has written a plugin called &#8220;MinusR&#8221; that basically flips RJS templates on their head. Instead [...]]]></description>
			<content:encoded><![CDATA[<p>RJS is a great little tool for interactively updating pieces of a page in response to some AJAX action, but it tends to fall short when you want to do anything beyond blinding dumping content into a page. <a href="http://www.danwebb.net/2006/11/17/rjs-minus-r">Dan Webb has written a plugin called &#8220;MinusR&#8221;</a> that basically flips RJS templates on their head. Instead of using Ruby generators to generate Javascript statements, you can write plain Javascript and are given a helper method to dump any Ruby statement to a properly escaped and encoded Javascript string.
 <a href="http://blog.antiarc.net/2007/04/24/rjs-minus-r/#more-29" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.antiarc.net/2007/04/24/rjs-minus-r/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ProxyPass and static resources</title>
		<link>http://blog.antiarc.net/2007/04/23/proxypass-and-static-resources/</link>
		<comments>http://blog.antiarc.net/2007/04/23/proxypass-and-static-resources/#comments</comments>
		<pubDate>Mon, 23 Apr 2007 10:12:46 +0000</pubDate>
		<dc:creator>Chris Heald</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://blog.antiarc.net/2007/04/23/proxypass-and-static-resources/</guid>
		<description><![CDATA[When proxying requests out to a load balancer, it&#8217;s often useful to avoid proxying some things. In the case of a Rails app, there is no need to proxy requests for images, JS, CSS, etc out to the Mongrel instances - Apache is perfectly capable of handling those itself. 

There are several methods of doing [...]]]></description>
			<content:encoded><![CDATA[<p>When proxying requests out to a load balancer, it&#8217;s often useful to avoid proxying some things. In the case of a Rails app, there is no need to proxy requests for images, JS, CSS, etc out to the Mongrel instances - Apache is perfectly capable of handling those itself. </p>

<p>There are several methods of doing this - one is to use RewriteRules to determine which URLs to not rewrite, but this is often more power than we need, and can be rather slow, depending on your implmentation. Fortunately, there&#8217;s a better way.</p>

<p><a href="http://blog.antiarc.net/2007/04/23/proxypass-and-static-resources/#more-28" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.antiarc.net/2007/04/23/proxypass-and-static-resources/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
