<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>ramblings, musing and code snippets from shawn veader</description><title>the codemonky</title><generator>Tumblr (3.0; @veader)</generator><link>http://codemonky.com/</link><item><title>iPhone Dev : Determining Text Height</title><description>&lt;p&gt;
OK, so you’re developing your application and programmatically laying out your UILabel. You want to know the height the label will ultimately be, so you can set the frame accordingly. You poke around and find the following method buried in NSString.
&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
sizeWithFont:forWidth:lineBreakMode:
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
Thinking you’ve struck gold, you proceed. Once you run your app you realize this method will never give you a height for more than one line. This has to be a bug, you think to yourself. 
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://openradar.appspot.com/radar?id=74427"&gt;http://openradar.appspot.com/radar?id=74427&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Nope! Apple says it works as intended. This seems like a waste because you can get the same information out of UIFont. Sigh.
&lt;/p&gt;

&lt;p&gt;
You end up having to go with NSString’s sizeWithFont:constrainedToSize:lineBreakMode: method and using a constraint with unlimited height. Here’s the full scoop.
&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
// determine your width before and put it here
CGSize constrainedSize = CGSizeMake(width, MAXFLOAT);
UIFont *textFont = [UIFont systemFontOfSize:13.0f];
NSString *text = @"Some very long string goes here...";
CGSize textSize = [text sizeWithFont:textFont 
                   constrainedToSize:constrainedSize 
                       lineBreakMode:UILineBreakModeWordWrap];
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
Hopefully some day Apple will fix that first method to do the sane thing, but don’t hold your breath.
&lt;/p&gt;</description><link>http://codemonky.com/post/426406617</link><guid>http://codemonky.com/post/426406617</guid><pubDate>Thu, 04 Mar 2010 11:07:00 -0500</pubDate></item><item><title>Running the iPhone 3.2 Beta... First Gotchas</title><description>&lt;p&gt;I installed the 3.2 beta the other day to play with the new iPad simulator. (&lt;em&gt;Neat stuff… more on that later.&lt;/em&gt;) But I tried working on one of my many half-completed iPhone apps the other night and ran into a few interesting problems. &lt;/p&gt;

&lt;p&gt;The first problem I encountered was that the credentials in my app were not saving to the user defaults. I scratched my head a few times with this but did get some good testing out of it.&lt;/p&gt;

&lt;p&gt;The second problem was the one that eventually led me to hitting Google in search of answers. After getting past some bugs I uncovered by not having user credentials, my app tried to load a standard table view. This table view has a custom cell loaded from a NIB. When the app tried to load this NIB, I was greeted with this wonderful message in the console.&lt;/p&gt;

&lt;blockquote&gt;
uncaught exception ‘NSInvalidUnarchiveOperationException’, reason: ‘*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (UITableViewCellContentView)’
&lt;/blockquote&gt;

&lt;p&gt;A few Google searches later and I found &lt;a href="http://stackoverflow.com/questions/2152321/weird-uitableviewcell-loading-exception"&gt;this response&lt;/a&gt; over on StackOverflow. However, I found it hard to believe that all of a sudden I needed to declare a class that was supposed to be built into the framework. I then started poking at XCode and the simulator and noticed something strange….&lt;/p&gt;

&lt;p&gt;I had opened my project from the console (yes, I’m *that* guy) with the “open” command as I always do. Unbeknownst to me this opened the newer XCode out of the alternate install. This turned out to be the root of all my problems. I opened /Developer/Applications/XCode.app and &lt;strong&gt;BOOM&lt;/strong&gt; everything started working again.&lt;/p&gt;

&lt;p&gt;So if you’re running dual development environments, watch out!&lt;/p&gt;</description><link>http://codemonky.com/post/372507885</link><guid>http://codemonky.com/post/372507885</guid><pubDate>Fri, 05 Feb 2010 11:23:02 -0500</pubDate></item><item><title>Obj-C Oddities</title><description>&lt;p&gt;I never seem to find enough time to be in Obj-C land long enough to develop muscle memory so there are things that consistently get me.

NSDictionary creation is backwards:

&lt;pre&gt;
NSDictionary *stuff = 
[NSDictionary dictionaryWithObjectsAndKeys:@"value1", @"key1", 
                                           @"value2", @"key2", nil];
&lt;/pre&gt; 

In Ruby-land (where I’ve been for quite some time) it would be:

&lt;pre&gt;
stuff = { :key1 =&gt; "value1", :key2 =&gt; "value2" }
&lt;/pre&gt;

&lt;b&gt;Almost forgot!&lt;/b&gt;

I also almost always forget the nil at the end of an NSDictionary or NSArray declaration.

For instance:

&lt;pre&gt;
NSArray *myList = [NSArray arrayWithObjects: @"foo", @"bar", @"baz", nil];
&lt;/pre&gt;

I continually forget that trailing nil, but it should be obvious since C is under the covers after all.&lt;/p&gt;</description><link>http://codemonky.com/post/321003062</link><guid>http://codemonky.com/post/321003062</guid><pubDate>Thu, 07 Jan 2010 00:08:36 -0500</pubDate></item><item><title>Zombies are your friend!</title><description>&lt;p&gt;No, they’re not here to eat your brain this time. They are here to &lt;i&gt;save&lt;/i&gt; it.&lt;/p&gt;

&lt;p&gt;So you’re happily coding along in Obj-C and developing the next big iPhone app. You build and run in the simulator only to see it crash and give &lt;b&gt;EXC_BAD_ACCESS&lt;/b&gt; in the console. You then spend a few minutes to a few hours (depending on how persistent you are) debugging and trying to chase down the problem (which, by the way, is usually trying to send a message to a released object). Compound this by having a multithreaded application (you are using threads, right?) and you can start to feel the frustration building.&lt;/p&gt;

&lt;p&gt;Now envision some zombies coming to help. Yes, zombies.&lt;/p&gt;

&lt;p&gt;Well… not &lt;i&gt;real&lt;/i&gt; zombies of course. &lt;/p&gt;

&lt;p&gt;&lt;br/&gt;
Objective-C was kind enough to include an awesome environment variable you can set that will leave around a dummy object for everything that is released so you can see where that &lt;b&gt;EXC_BAD_ACCESS&lt;/b&gt; is coming from.&lt;/p&gt;

&lt;p&gt;The environment variable is &lt;b&gt;NSZombieEnabled&lt;/b&gt;. Edit the executable options in XCode and create a new environment variable named &lt;b&gt;NSZombieEnabled&lt;/b&gt; and set the value to &lt;b&gt;YES&lt;/b&gt;. It should look like this:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://img.skitch.com/20090728-nt3pgp52n4dw4xps862cajr56k.jpg"/&gt;&lt;/p&gt;

&lt;p&gt;Now build and run and see what you get. Enjoy!&lt;/p&gt;</description><link>http://codemonky.com/post/150858649</link><guid>http://codemonky.com/post/150858649</guid><pubDate>Tue, 28 Jul 2009 10:06:43 -0400</pubDate></item><item><title>Animated GIFs and UIImageViews</title><description>&lt;p&gt;OK, so while building an iPhone app last night I ran into a little snag. We are using an animated GIF on the loading screen to allow the user to see something pretty while they wait. &lt;/p&gt;

&lt;p&gt;Being naive, I assumed the UIImageView would display the animated GIF. Well… I was partially right. It does display the GIF but only the first frame.&lt;/p&gt;

&lt;p&gt;Then the Google hunt began…&lt;/p&gt;

&lt;p&gt;After some searching, I had found that you can set the animatedImages property of a UIImageView to a NSArray that contains each frame of the animated GIF and then call the startAnimating method to “play” it.&lt;/p&gt;

&lt;p&gt;OK, great…. now how do I get the frames out? After more Googling I just tried Preview.app on a wild hair. I’m glad to report that it shows the animated GIF but in the drawer of the app, it also has each frame. Simply drag each of these out and boom! you’re set.&lt;/p&gt;

&lt;p&gt;Now for the code sample.&lt;/p&gt;

&lt;pre&gt;
UIImage *frame0 = [UIImage imageNamed:@"frame0.png"];
// ... more frames here ...
UIImage *frameN = [UIImage imageNamed:@"frameN.png"];

// animatedGif is a UIImageView initialized in your NIB or elsewhere.
animatedGif.animatedImages = [[NSArray alloc] initWithObjects:frame0
                                                              ....
                                                              frameN,
                                                              nil];
[animatedGif startAnimating];
&lt;/pre&gt; 

&lt;p&gt;There are a few other things you can play with like the animatedDuration and animatedRepeatCount properties. But you can figure those out.&lt;/p&gt;

&lt;p&gt;And a link to the UIImageView documentation for completeness… &lt;a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIImageView_Class/Reference/Reference.html"&gt;UIImageView&lt;/a&gt;&lt;/p&gt;</description><link>http://codemonky.com/post/129361909</link><guid>http://codemonky.com/post/129361909</guid><pubDate>Wed, 24 Jun 2009 10:00:00 -0400</pubDate></item><item><title>Must haves for Safari</title><description>&lt;p&gt;So I’m back on Safari, for the moment, (no offense Firefox) and I just wanted to pass along two plugins that you must install.&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;&lt;b&gt;Click-to-Flash&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://github.com/rentzsch/clicktoflash/tree/master"&gt;http://github.com/rentzsch/clicktoflash/tree/master&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This replaces any flash on a website with a little logo that says “Flash”. If you actually want to see the flash you just click it and it loads. Works very well to keep the browser from chewing up all your computing resources running Flash. (Adobe: why is Flash so horrible?)&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;&lt;b&gt;AdBlock&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://burgersoftware.com/en/safariadblock"&gt;http://burgersoftware.com/en/safariadblock&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recent addition for me but blocks ad content for a more pleasant browsing experience.&lt;/p&gt;</description><link>http://codemonky.com/post/124697120</link><guid>http://codemonky.com/post/124697120</guid><pubDate>Tue, 16 Jun 2009 13:49:00 -0400</pubDate></item><item><title>Starting down the path of objectifying C</title><description>&lt;p&gt;OK, so I’ve had my head in and out of books lately trying to learn obj-C and Cocoa. So far it’s not too bad. Kinda fun to be back into a little more strict C-style world, while still maintaining some cool OO features. &lt;/p&gt;

&lt;p&gt;My biggest gotchas/gripes I’ve found so far? &lt;/p&gt;

&lt;p&gt;1) Having to add a nil to the end of a declared NSArray or NSDictionary (or their mutable variants).&lt;/p&gt;

&lt;pre&gt;
[NSArray arrayWithObjects:@"1", @"2", @"3", nil];
&lt;/pre&gt;

&lt;p&gt;That just seems like something that could be abstracted away for you…&lt;/p&gt;

&lt;p&gt;2) Declaring a NSDictionary with keys and values is backward from what I would expect from Ruby land.&lt;/p&gt;

&lt;pre&gt;
// what I expect
[NSDictionary dictionaryWithObjectsAndKeys:
              @"key1", @"value1", @"key2", @"value2",nil];
// what reality is
[NSDictionary dictionaryWithObjectsAndKeys:
              @"value1", @"key1", @"value2", @"key2",nil];
&lt;/pre&gt;

&lt;p&gt;3) And as you can see from the examples above… the biggest gotcha of all is that to declare a string you have to prefix it with @.&lt;/p&gt;

&lt;p&gt;(Hopefully I’ll start actually putting up stuff on this tumblelog again now…)&lt;/p&gt;</description><link>http://codemonky.com/post/99360011</link><guid>http://codemonky.com/post/99360011</guid><pubDate>Thu, 23 Apr 2009 14:12:49 -0400</pubDate></item><item><title>Orkut.com.br needs to die!</title><description>&lt;p&gt;Yes, I’m just one of the many who have fallen into the stupid Brazilian Orkut fake kid pages. There is a whole profile based off images from my Flickr stream.
&lt;br/&gt;&lt;br/&gt;

&lt;a href="http://www.orkut.com/Main#Album.aspx?uid=6447389076309092886&amp;aid=1230630259"&gt;http://www.orkut.com/Main#Album.aspx?uid=6447389076309092886&amp;aid=1230630259&lt;/a&gt;
&lt;br/&gt;
&lt;a href="http://www.orkut.com/Main#Album.aspx?uid=499062161829329821&amp;aid=1"&gt;http://www.orkut.com/Main#Album.aspx?uid=499062161829329821&amp;aid=1&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;

I know I could toggle the “Friends &amp; Family” setting on Flickr but I have too many people who look at my stream who are real friends and family that I don’t want to have to send a link or require them to sign up to see the pictures.
&lt;br/&gt;&lt;br/&gt;

Of course Google, the owner of Orkut.com, is of absolutely no help. Reporting abuse on the site gives me this wonderful canned response:


&lt;/p&gt;
&lt;blockquote&gt;
Thank you for your reporting of abuse on Orkut on “2009-01-06”. &lt;br/&gt;&lt;br/&gt;

Based on our review and consideration of Orkut’s terms of service, we understand that this content does not currently break any policies on Orkut. If you believe that a mistake has been made, please re-submit your complaint with additional information to help our support team better understand your concerns with this content.
&lt;/blockquote&gt;

Thanks Google. &lt;strong&gt;Thanks!!!!?!?!&lt;/strong&gt;
&lt;br/&gt;&lt;br/&gt;

Glad they are so willing to help fight their site turning into a steaming pile of crap with pedophiles, etc.
&lt;br/&gt;&lt;br/&gt;

Sigh, such is life on the interwebs.
&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;&lt;em&gt;Update:&lt;/em&gt;&lt;/strong&gt; a friend of a friend works at Google and was able to get at least one of the accounts nuked this morning.</description><link>http://codemonky.com/post/68724241</link><guid>http://codemonky.com/post/68724241</guid><pubDate>Tue, 06 Jan 2009 10:27:00 -0500</pubDate></item><item><title>Testing... Testing... This thing on?</title><description>&lt;p&gt;Well it looks pike I forgot about my tumblog for some time now. Guess it is time to resurrect it. &lt;/p&gt;

&lt;p&gt;Stay tunes for ramblings about languages I’m learning at the moment. &lt;/p&gt;

&lt;p&gt;First up…. Erlang.&lt;/p&gt;</description><link>http://codemonky.com/post/59753977</link><guid>http://codemonky.com/post/59753977</guid><pubDate>Fri, 14 Nov 2008 20:46:43 -0500</pubDate></item><item><title>Google does Atlanta</title><description>&lt;img src="http://30.media.tumblr.com/LdzHTkOYNagm53fyLP1PFryP_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Google does Atlanta&lt;/p&gt;</description><link>http://codemonky.com/post/39185058</link><guid>http://codemonky.com/post/39185058</guid><pubDate>Fri, 20 Jun 2008 13:36:39 -0400</pubDate></item><item><title>Endless Pages</title><description>&lt;p&gt;Having heard a blurb on an endless page plugin on the &lt;a href="http://railsenvy.com"&gt;RailsEnvy&lt;/a&gt; podcast, I decided to check it out. I wasn’t happy with how the plugin worked, so I whipped up something similar.&lt;/p&gt;
&lt;p&gt;(Original post mentioned on RailsEnvy: &lt;a href="http://bewhite.blogspot.com/2008/05/rails-endless-page-plugin.html"&gt;link&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;I decided most of what was needed was a mix of the wonderful will_paginate plugin and some Javascript. Thus &lt;b&gt;endlesspage.js&lt;/b&gt; was born.&lt;/p&gt;
&lt;p&gt;After including endlesspage.js in your layout, you should be able to do follow along below on how to set it up.&lt;/p&gt;
&lt;p&gt;In the &lt;strong&gt;Controller&lt;/strong&gt;: &lt;a href="http://pastie.org/197801"&gt;pastie&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the &lt;strong&gt;Views&lt;/strong&gt;: &lt;a href="http://pastie.org/197803"&gt;pastie&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is the file: &lt;a href="http://pastie.org/197806"&gt;endlesspage.js&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;(Sorry, but I couldn’t get Tumblr to cooperate with dumping in code.) &lt;/p&gt;
&lt;p&gt;Let me know if you find this helpful… &lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; I was informed (and confirmed myself) that the gem version of will_paginate doesn’t have the page_count method. The substitute method is total_pages.&lt;/p&gt;</description><link>http://codemonky.com/post/34940898</link><guid>http://codemonky.com/post/34940898</guid><pubDate>Thu, 15 May 2008 16:19:00 -0400</pubDate></item><item><title>Video</title><description>&lt;object width="400" height="336"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Tbxq0IDqD04&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/Tbxq0IDqD04&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1" type="application/x-shockwave-flash" width="400" height="336" allowFullScreen="true" wmode="transparent"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://codemonky.com/post/32181874</link><guid>http://codemonky.com/post/32181874</guid><pubDate>Fri, 18 Apr 2008 16:28:49 -0400</pubDate></item><item><title>silencing deprecations</title><description>&lt;p&gt;OK, so if you’re stuck in Rails 1.2.X land like I am, you’re probably tired of seeing all the deprecation warnings when you run your test suite. (Yes, I know pagination is going away but someone might severly punish me for will_paginate at the moment.)&lt;/p&gt;
&lt;p&gt; Add this to your test/test_helper.rb&lt;/p&gt;
&lt;pre&gt; &lt;p&gt; ActiveSupport::Deprecation.silenced= true &lt;br/&gt;&lt;/p&gt;&lt;/pre&gt; </description><link>http://codemonky.com/post/31491014</link><guid>http://codemonky.com/post/31491014</guid><pubDate>Fri, 11 Apr 2008 14:34:57 -0400</pubDate></item><item><title>Git on OSX</title><description>&lt;p&gt;Hit a roadblock compiling git tonight. Thanks to jnewland for the last piece of the puzzle.&lt;/p&gt; &lt;pre&gt;curl -O &lt;a href="http://kernel.org/pub/software/scm/git/git-1.5.4.5.tar.bz2"&gt;http://kernel.org/pub/software/scm/git/git-1.5.4.5.tar.bz2&lt;/a&gt; &lt;br/&gt;tar ixf git-1.5.4.5.tar.bz2 &lt;br/&gt;cd git-1.5.4.5 &lt;br/&gt;./configure --prefix=/usr/local &lt;br/&gt;make NO_MSGFMT=1 &lt;br/&gt;sudo make install  &lt;/pre&gt;</description><link>http://codemonky.com/post/31414966</link><guid>http://codemonky.com/post/31414966</guid><pubDate>Thu, 10 Apr 2008 23:00:24 -0400</pubDate></item><item><title>Apple goodness</title><description>&lt;img src="http://26.media.tumblr.com/LdzHTkOYN7bnicyuiZxTBGyA_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Apple goodness&lt;/p&gt;</description><link>http://codemonky.com/post/30581804</link><guid>http://codemonky.com/post/30581804</guid><pubDate>Wed, 02 Apr 2008 12:20:17 -0400</pubDate></item><item><title>establish_connection may harm you</title><description>&lt;p&gt;So I have a reporting Rails application that is looking at the databases of two other Rails apps. I import the models using an svn:external link. I then have initializers that do a bit of “magic” switching which databases the models use and what their table names are based on the schema. We use Postgres so the “databases” are actually schemas in the same physical database.&lt;/p&gt; &lt;code&gt;&lt;/code&gt;&lt;pre&gt;unless RAILS_ENV.downcase == 'test'&lt;br/&gt;  # point all of the vanguard models to the champion_#{RAILS_ENV} database&lt;br/&gt;  Dir[File.expand_path('app/models/vanguard/*.rb',RAILS_ROOT)].each do |file|&lt;br/&gt;    model_str = $1.classify if file =~ /\/vanguard\/(.*?)\.rb$/&lt;br/&gt;&lt;br/&gt;    next unless model_str&lt;br/&gt;    # skip the models that aren't active record models&lt;br/&gt;    next if %w(...).include?(model_str)&lt;br/&gt;&lt;br/&gt;    eval("#{model_str}.instance_eval('establish_connection \"champion_#{RAILS_ENV}\"')")&lt;br/&gt;    table_name = eval("#{model_str}.table_name")&lt;br/&gt;    eval("#{model_str}.instance_eval('set_table_name \"vanguard.#{table_name}\"')") &lt;br/&gt;  end&lt;br/&gt;end &lt;/pre&gt; &lt;p&gt;I kept running into a problem where the maximum number of connections to this database was being exceeded. After poking around some I believe establish_connection isn’t doing the smart thing. It seems to blindly establish a connection each time it is called disregarding the fact that the connection might already be open.&lt;/p&gt;
&lt;p&gt; I switched the logic such that the “primary” database is now this external connection and sub-class all of my internal models to use an abstract ActiveRecord class that points to a different database. The number of connections has dropped significantly. &lt;/p&gt;</description><link>http://codemonky.com/post/29190425</link><guid>http://codemonky.com/post/29190425</guid><pubDate>Tue, 18 Mar 2008 10:46:00 -0400</pubDate></item><item><title>Ordering Matters</title><description>&lt;p&gt;So I found another interesting gotcha in Rails today.&lt;/p&gt;
&lt;p&gt;Some background: I have a reporting application that uses models from a running application that I can’t touch the code for for fear of the FDA overlords. In doing some of the reports, I want to “fix” things that were left out of the original application. For instance the office model should be associated with the patients that belong to it; however, this is not the case.&lt;/p&gt;
&lt;p&gt; Knowing the fun of “monkey patching”, I can easily add this association in my action on the reporting app with something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Office.class_eval("has_many :patients")&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; Now office.patients works.&lt;/p&gt;
&lt;p&gt; Then I wanted to have the count of patients for each office so I used the same trick to have a variable to stuff the count in, ala:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Office.class_eval("attr_accessor :patient_count")&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; Now office.patient_count = office.patients.count works like a charm.&lt;/p&gt;
&lt;p&gt; Here’s where the gotcha occurred. I was actually putting a condition on the count.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;offices.each do |o|&lt;br/&gt;   o.patient_count = o.patients.count(1, :conditions =&gt; {:var =&gt; 'blah'})&lt;br/&gt;end &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; I noticed later that the conditions were being ignored. Odd…&lt;/p&gt;
&lt;p&gt; Here was the problem. I had the attr_accessor class_eval statement before the has_many class_eval. For some reason the order matters. Switching the two made things happy. &lt;/p&gt;</description><link>http://codemonky.com/post/27430234</link><guid>http://codemonky.com/post/27430234</guid><pubDate>Wed, 27 Feb 2008 10:26:00 -0500</pubDate></item><item><title>the original, just for comparison to get some of the scenes from...</title><description>&lt;object width="400" height="336"&gt;&lt;param name="movie" value="http://www.youtube.com/v/jjXyqcx-mYY&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/jjXyqcx-mYY&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1" type="application/x-shockwave-flash" width="400" height="336" allowFullScreen="true" wmode="transparent"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;the original, just for comparison to get some of the scenes from the spoof &lt;/p&gt;</description><link>http://codemonky.com/post/26160136</link><guid>http://codemonky.com/post/26160136</guid><pubDate>Tue, 12 Feb 2008 11:30:34 -0500</pubDate></item><item><title>not taking sides and i’m sure most of this is out of...</title><description>&lt;object width="400" height="336"&gt;&lt;param name="movie" value="http://www.youtube.com/v/3gwqEneBKUs&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/3gwqEneBKUs&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1" type="application/x-shockwave-flash" width="400" height="336" allowFullScreen="true" wmode="transparent"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;not taking sides and i’m sure most of this is out of context, but this is pretty funny.  &lt;/p&gt;</description><link>http://codemonky.com/post/26159354</link><guid>http://codemonky.com/post/26159354</guid><pubDate>Tue, 12 Feb 2008 11:20:10 -0500</pubDate></item><item><title>Why can’t all card readers work this way?</title><description>&lt;img src="http://24.media.tumblr.com/LdzHTkOYN4oe0gvbviNVHDuR_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Why can’t all card readers work this way?&lt;/p&gt;</description><link>http://codemonky.com/post/24742633</link><guid>http://codemonky.com/post/24742633</guid><pubDate>Sat, 26 Jan 2008 18:17:34 -0500</pubDate></item></channel></rss>
