<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
    <title>ChasingSparks</title>
    <link rel="self" type="application/atom+xml" href="http://www.chasingsparks.com/atom.xml" />
    <link rel="alternate" type="text/html" href="http://www.chasingsparks.com/" />
    <id>tag:typepad.com,2003:weblog-1543812</id>
    <updated>2008-02-07T08:50:57-08:00</updated>
    <subtitle>A series of unexpected mistakes.</subtitle>
    <generator uri="http://www.typepad.com/">TypePad</generator>
    <entry>
        <title>Facebooker and Rails 2.0</title>
        <link rel="alternate" type="text/html" href="http://www.chasingsparks.com/2008/02/facebooker-and.html" />
        <link rel="replies" type="text/html" href="http://www.chasingsparks.com/2008/02/facebooker-and.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-45274666</id>
        <published>2008-02-07T08:50:57-08:00</published>
        <updated>2008-02-07T08:51:09-08:00</updated>
        <summary>Using the default cookie session storage in Rails 2.0 will result in Facebooker errors.</summary>
        <author>
            <name>John Nelson</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Rails" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.chasingsparks.com/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>If you are using the Ruby <a href="http://facebooker.rubyforge.org/">Facebooker</a> plugin for developing Rails Facebook apps, you should note that the default cookie-based session storage engine is going to give you some weird errors concerning your Facebook session key being invalid or no longer valid. I assume that <a href="http://rfacebook.rubyforge.org/">RFacebook</a> would have the same problem, but I am just toying around, not seriously investigating Facebook development. </p>

<p>The obvious fix is to switch to a alternative session storage engine (e.g. active_record_store). <br /></p></div>
</content>


    </entry>
    <entry>
        <title>Mate1 on Facebook </title>
        <link rel="alternate" type="text/html" href="http://www.chasingsparks.com/2008/01/mate1-on-facebo.html" />
        <link rel="replies" type="text/html" href="http://www.chasingsparks.com/2008/01/mate1-on-facebo.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-44557998</id>
        <published>2008-01-23T10:14:10-08:00</published>
        <updated>2008-01-23T10:14:32-08:00</updated>
        <summary>Another reason why Facebook is not worth 11 billion dollars.</summary>
        <author>
            <name>John Nelson</name>
        </author>
        
        <category scheme="http://sixapart.com/ns/types#tag" term="faecbook" />
        <category scheme="http://sixapart.com/ns/types#tag" term="foaf" />
        <category scheme="http://sixapart.com/ns/types#tag" term="mate1" />
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.chasingsparks.com/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>Here is another reason why Facebook is not worth anywhere near what recent valuations have suggested. I logged into my account to partake in my socially voyeuristic morning ritual and was greeted by the following ad:</p>

<p><a href="http://chasingsparks.typepad.com/.shared/image.html?/photos/uncategorized/2008/01/23/mate_1_ad.gif" onclick="window.open(this.href, '_blank', 'width=179,height=220,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img width="100" height="122" border="0" alt="Mate_1_ad" title="Mate_1_ad" src="http://www.chasingsparks.com/images/2008/01/23/mate_1_ad.gif" style="margin: 0px 5px 5px 0px;" /></a></p><br /><p>Yes, it is a Mate1 ad. For those of you unfamiliar, Mate1 bills itself as &quot;The web's largest intimate dating site, with millions of members in the
U.S. and worldwide. Sign up today, 100% FREE for women. Men pay a
monthly fee.&quot; It's a casual sex website. </p>

<p>Google my accept money from adult-oriented advertisers, but the targeting is limited to people searching for a relevant term. Facebook pushed this ad on me because I am a young male. I would prefer not to see adult advertising on my &quot;social utility&quot;.</p>

<p>Moreover, when was the last time you (and by that I mean a man in his 20s because that is what my experience is bound by) saw a Facebook ad for anything but an online dating site or novelty T-Shirts. The mini-feed ads are more diverse, but by now my mind has them so filtered they rarely enter my conciousness. </p>

<p>Facebook has peaked and is now on its decent. Long live <a href="http://www.foaf-project.org/">FOAF</a> and it's yet-to-be-seen replacement.</p></div>
</content>


    </entry>
    <entry>
        <title>iGoogle Finance App gives Information is temporarily unavailable.</title>
        <link rel="alternate" type="text/html" href="http://www.chasingsparks.com/2008/01/igoogle-finance.html" />
        <link rel="replies" type="text/html" href="http://www.chasingsparks.com/2008/01/igoogle-finance.html" thr:count="1" thr:updated="2008-03-12T15:04:16-07:00" />
        <id>tag:typepad.com,2003:post-44285218</id>
        <published>2008-01-17T06:35:34-08:00</published>
        <updated>2008-01-17T06:40:59-08:00</updated>
        <summary>iGoogle finance app won&#39;t work on your custom domain Google Apps account.</summary>
        <author>
            <name>John Nelson</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Web/Tech" />
        
        <category scheme="http://sixapart.com/ns/types#tag" term="google finance" />
        <category scheme="http://sixapart.com/ns/types#tag" term="igoogle finance" />
        
<content type="html" xml:lang="en-US" xml:base="http://www.chasingsparks.com/">
&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;p&gt;If you are getting a &amp;quot;&lt;em&gt;Information is temporarily unavailable&amp;quot;&lt;/em&gt; from iGoogle&#39;s Finance App on a Google Apps Start Page and you are using your own domain, you won&#39;t ever see anything else. At first, I checked Googles help section and found a &lt;a href=&quot;http://www.google.com/support/a/users/bin/answer.py?answer=38550&amp;amp;topic=10126&quot;&gt;thread for this error message&lt;/a&gt;. From the thread: &amp;quot;&lt;/span&gt;The &amp;quot;Information is temporarily unavailable&amp;quot; message is most likely
caused by a temporary problem with a third-party gadget provider. This
issue is usually resolved quickly, so we encourage you to check back
soon.&amp;quot;&lt;/p&gt;

&lt;p&gt;Okay, but this isn&#39;t a third party app and the message has persisted for 3 days. Doesn&#39;t seem right. Then I found an blog post for &lt;a href=&quot;http://googlefinanceblog.blogspot.com/2007/10/api-gadgets-and-tabs-oh-my.html&quot;&gt;the announcement of this app&lt;/a&gt; on the &lt;a href=&quot;http://googlefinanceblog.blogspot.com/&quot;&gt;Google Finance blog&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;From the post: &amp;quot;But wait, there&#39;s more! If you&#39;re a developer, we just made it easier
for you to make a stock market gadget with our new API. The gadget API
for market data provides a framework so developers can display stock
market information from the American, Nasdaq and New York stock
exchanges within a gadget on Google properties. Unfortunately, due to
data licensing restrictions, we couldn&#39;t open this API for display on
any platform.&amp;quot;&lt;/p&gt;

&lt;p&gt;The iGoogle Finance App uses this API and, because my Google app uses it&#39;s own domain for the start page, it probably uses AJAX policy to prohibit my use (speculation because I don&#39;t care enough to look). So much for that.&lt;/p&gt;&lt;/div&gt;
</content>


    </entry>
    <entry>
        <title>Using :joins in ActiveRecord</title>
        <link rel="alternate" type="text/html" href="http://www.chasingsparks.com/2008/01/using-joins-in.html" />
        <link rel="replies" type="text/html" href="http://www.chasingsparks.com/2008/01/using-joins-in.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-44234468</id>
        <published>2008-01-16T08:01:54-08:00</published>
        <updated>2008-01-16T08:04:51-08:00</updated>
        <summary>A post so I remember the utility of :joins.</summary>
        <author>
            <name>John Nelson</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Rails" />
        
        <category scheme="http://sixapart.com/ns/types#tag" term="activerecord" />
        <category scheme="http://sixapart.com/ns/types#tag" term="rails" />
        
<content type="html" xml:lang="en-US" xml:base="http://www.chasingsparks.com/">
&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;p&gt;I always seem to forget about the :joins option in &lt;a href=&quot;http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001376&quot;&gt;ActiveRecord&lt;/a&gt;. It is incredibly useful for a certain class of not-to-often needed problems. Like &lt;a href=&quot;http://loudthinking.com/&quot;&gt;DHH&lt;/a&gt; says, Ruby on Rail&#39;s will let you do anything but will impose it&#39;s opinions by making some things more painful.&lt;/p&gt;

&lt;p&gt;Let&#39;s say I have the following models:&lt;/p&gt;

	&lt;div class=&quot;allcode&quot;&gt;
		&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot;&gt;
		&lt;tbody&gt;&lt;tr&gt;
			&lt;td&gt;
				
				
			&lt;/td&gt;

		&lt;td&gt;
		&lt;pre class=&quot;textmate-source&quot;&gt;&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;meta meta_rails meta_rails_model&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;Contact&lt;span class=&quot;entity entity_other entity_other_inherited-class entity_other_inherited-class_ruby&quot;&gt; &amp;lt; ActiveRecord::Base&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp; &lt;span class=&quot;support support_function support_function_activerecord support_function_activerecord_rails&quot;&gt;belongs_to&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:user&lt;/span&gt;
&amp;nbsp; &lt;span class=&quot;support support_function support_function_activerecord support_function_activerecord_rails&quot;&gt;has_many&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:receipts&lt;/span&gt;

&lt;/span&gt;&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_rails meta_rails_model&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;User&lt;span class=&quot;entity entity_other entity_other_inherited-class entity_other_inherited-class_ruby&quot;&gt; &amp;lt; ActiveRecord::Base&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp; &lt;span class=&quot;support support_function support_function_activerecord support_function_activerecord_rails&quot;&gt;has_many&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:contacts&lt;/span&gt;
&amp;nbsp; &lt;span class=&quot;support support_function support_function_activerecord support_function_activerecord_rails&quot;&gt;has_many&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:roles&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;# Roles in many different product lines&lt;/span&gt;

&lt;/span&gt;&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;meta meta_rails meta_rails_model&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;Role&lt;span class=&quot;entity entity_other entity_other_inherited-class entity_other_inherited-class_ruby&quot;&gt; &amp;lt; ActiveRecord::Base&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp; &lt;span class=&quot;support support_function support_function_activerecord support_function_activerecord_rails&quot;&gt;belongs_to&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:user&lt;/span&gt;
&amp;nbsp; &lt;span class=&quot;support support_function support_function_activerecord support_function_activerecord_rails&quot;&gt;belongs_to&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:product_line&lt;/span&gt;

&lt;/span&gt;&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/pre&gt;
		&lt;/td&gt;
		&lt;/tr&gt;
		&lt;/tbody&gt;&lt;/table&gt;
	
	&lt;/div&gt;

&lt;p&gt;Now, let&#39;s say I have a receipt that says only which contact paid and the amount of money received, not which user made the sale (I am obfuscating what my app actually does with this salesman analogy.) I have to do a join from the contact table to the user table to the roles table (users can have identical contacts but may not necessarily be selling the same product). Basically, :include=&amp;gt;[...] won&#39;t work.&lt;/p&gt;

&lt;p&gt;Instead, you use the wonderful little :joins=&amp;gt;... option.&lt;/p&gt;
	
	



	
	&lt;div class=&quot;allcode&quot;&gt;
		&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot;&gt;
		&lt;tbody&gt;&lt;tr&gt;
			&lt;td&gt;
				
				
			&lt;/td&gt;

		&lt;td&gt;
		&lt;pre class=&quot;textmate-source&quot;&gt;&lt;pre class=&quot;sunburst&quot;&gt;...&lt;br /&gt;conditions_string &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&#39; AND `users`.id=`contacts`.user_id AND `roles`.user_id=`users`.id AND `roles`.product_line_id=:product_line_id&#39;&lt;/span&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; conditions[&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:product_line_id&lt;/span&gt;]&lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt;params[&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:product_line_id&lt;/span&gt;]&lt;br /&gt;&lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;@contacts&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Contact&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_method meta_function-call_method_with-arguments meta_function-call_method_with-arguments_ruby&quot;&gt;.&lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;find&lt;/span&gt;&lt;/span&gt;(&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:all&lt;/span&gt;, &lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:conditions&lt;/span&gt;=&amp;gt;[conditions_string, conditions],&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:joins&lt;/span&gt;=&amp;gt;&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&#39;,`users`,`roles`&#39;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/pre&gt;
		&lt;/td&gt;
		&lt;/tr&gt;
		&lt;/tbody&gt;&lt;/table&gt;
	
	&lt;/div&gt;






&lt;/div&gt;
</content>


    </entry>
    <entry>
        <title>Don&#39;t Lend Friends and Family Money! Why?</title>
        <link rel="alternate" type="text/html" href="http://www.chasingsparks.com/2008/01/dont-lend-frien.html" />
        <link rel="replies" type="text/html" href="http://www.chasingsparks.com/2008/01/dont-lend-frien.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-44231240</id>
        <published>2008-01-16T07:31:32-08:00</published>
        <updated>2008-01-16T17:30:17-08:00</updated>
        <summary>Why I think it is good to lend money to friends.</summary>
        <author>
            <name>John Nelson</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Wasted Bytes" />
        
        <category scheme="http://sixapart.com/ns/types#tag" term="borrowing money" />
        
<content type="html" xml:lang="en-US" xml:base="http://www.chasingsparks.com/">
&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;p&gt;I seem to be arguing with people a lot more these days.&amp;nbsp; In the past, I
didn&#39;t argue often because I didn&#39;t care if I managed to change
someone&#39;s opinion. What did that earn me? Why waste the effort?&amp;nbsp; Now, I
argue a lot more.&amp;nbsp; I still don&#39;t care whether or not I convince a
person that my side is right, but I have found that arguing tends to
refine my own ideas and help prevent myself from falling prey to
still-life mistakes.&lt;/p&gt;

&lt;p&gt;
Recently, a friend of mine said he, as a rule, doesn&#39;t lend family or
friends money (I mean more than the amount required to buy a few drinks
at the bar).&amp;nbsp; I strongly disagree with this rule.&amp;nbsp; In my own
experience, I have often been a borrower from friends and family.&amp;nbsp; As a
personal rule of my own, I repay debts and do so with interest.&amp;nbsp; &lt;/p&gt;

&lt;p&gt;
Now, I understand that some people might be afraid that if the debtor
can&#39;t pay back the creditor, it could put strains on the friendship – a
real possibility.&amp;nbsp; On the other hand, the borrower is certainly going
to be grateful to the creditor, his or her friend, for showing a vote
of confidence in them.&amp;nbsp; I think, in terms of the friendship, the
effects of fear and gratitude nullify each other.&lt;/p&gt;

&lt;p&gt;
A much more poignant example is in funding a business venture.&amp;nbsp; If the
person is a genuine friend of mine, I generally assume are more likely
to pay me back.&amp;nbsp; The instinct of reciprocity is much stronger amongst
friends.&amp;nbsp; Now, certainly, if I think the person is incapable of pulling
off their chosen venture or that the chosen venture is bad, I will
obviously say no (the former case being a much bigger deal-breaker than
the latter).&amp;nbsp; &lt;/p&gt;

&lt;p&gt;
If I do think the venture is bad, I will explain why.&amp;nbsp; Actually, saying
“I don&#39;t lend to friends and family” when you honestly mean, “I think
your idea is bad” is a pretty shitty thing for a friend to do.&amp;nbsp; If my
friend is completely smashed after a night spent with Jägermeister, I
wouldn&#39;t let him drive home.&amp;nbsp; Same rule applies. If you value the
well-being of your friends, you should step up and explain why you
think their idea is bad, even if it momentarily offends them.&lt;/p&gt;

&lt;p&gt;
Also, I expect my reward for the risk taken to be commensurate with
that which would be given to me by an anonymous entrepreneur.&amp;nbsp; Maybe
that&#39;s due to the influence &lt;a href=&quot;http://en.wikipedia.org/wiki/Atlas_Shrugged&quot;&gt;Atlas Shrugged&lt;/a&gt; had on me, but clearly, I am
still taking a risk and should be compensated.&amp;nbsp; No, I am not going to
lend my friends money at the bar and then calculate the interest owed
two day&#39;s later.&amp;nbsp; That would be offensive and cheap in the bad sense. 
I didn&#39;t really forgo any possible profit in those two days.&amp;nbsp; That
money was in my wallet or on my credit card.&amp;nbsp; In both cases, the amount
being so small, it wasn&#39;t on it&#39;s way to my brokerage account. &lt;/p&gt;

&lt;p&gt;
I guess what I am trying to say is, “Don&#39;t let friend do dumb things
without objecting.” If a friend has a good idea and they are capable,
it&#39;s a good investment.&amp;nbsp; If the idea is bad, tell them.&amp;nbsp; If the friend
has a good idea, is capable, and is not respectable….why are they your
friend?&lt;/p&gt;
&lt;/div&gt;
</content>


    </entry>
    <entry>
        <title>Ordering error_messages_for in Rails</title>
        <link rel="alternate" type="text/html" href="http://www.chasingsparks.com/2008/01/ordering-error_.html" />
        <link rel="replies" type="text/html" href="http://www.chasingsparks.com/2008/01/ordering-error_.html" thr:count="3" thr:updated="2008-05-08T03:11:01-07:00" />
        <id>tag:typepad.com,2003:post-44052478</id>
        <published>2008-01-12T08:04:24-08:00</published>
        <updated>2008-01-12T08:04:31-08:00</updated>
        <summary>Due to laziness, I have not, in the past, given much back to the open-source community. I would like to start doing so. For the most part, I think Rails is an elegant solution to web application development. That is...</summary>
        <author>
            <name>John Nelson</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Rails" />
        
        <category scheme="http://sixapart.com/ns/types#tag" term="error_messages_for" />
        <category scheme="http://sixapart.com/ns/types#tag" term="rails form helper" />
        <category scheme="http://sixapart.com/ns/types#tag" term="ruby on rails" />
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.chasingsparks.com/">
<div xmlns="http://www.w3.org/1999/xhtml">
<p class="MsoNormal">Due to laziness, I have not, in the past, given much back to
the open-source community. I would like
to start doing so.</p>



<p class="MsoNormal">For the most part, I think Rails is an elegant solution to
web application development. That is why
I find it shocking that error_messages_for is still unordered due to hash
storage. It is a pet peeve of mine to
get a form with multiple errors that do not match the order presentation by the
form. It just seems sloppy.</p>



<p class="MsoNormal">Anyways, I took the time to write a plugin named
ordered_error_messages_for. It extends
the core so that if you supply :order=&gt;[:attr1,:attr2, …] to
error_messages_for(…) you get a clean orderly display of errors. </p>



<p class="MsoNormal">Example:</p>



<p class="MsoNormal"><strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">error_messages_for(:user,
:order=&gt;[:name,:password,:phone_number])<o:p></o:p><br />error_messages_for(:user,
:order=&gt;{:user=&gt;[:name,:password,:phone_number]})</span></strong></p>

<p class="MsoNormal">Install it with a:</p>

<p class="MsoNormal"><strong>./script/plugin install http://orderederrors.rubyforge.org/svn/ordered_error_messages_for</strong></p>

<p>More information at:<br /><a href="http://orderederrors.rubyforge.org/">orderederrrors on RubyForge</a></p>

<p class="MsoNormal">Sexy. Rails Sexy.</p>

</div>
</content>


    </entry>
    <entry>
        <title>Sharding with Cookie-Based Sessions</title>
        <link rel="alternate" type="text/html" href="http://www.chasingsparks.com/2008/01/sharding-with-c.html" />
        <link rel="replies" type="text/html" href="http://www.chasingsparks.com/2008/01/sharding-with-c.html" thr:count="3" thr:updated="2008-01-10T12:26:37-08:00" />
        <id>tag:typepad.com,2003:post-43968374</id>
        <published>2008-01-10T10:07:14-08:00</published>
        <updated>2008-01-10T10:07:20-08:00</updated>
        <summary>My experiment with decoupled shards and rails cookie-based sessions storage.</summary>
        <author>
            <name>John Nelson</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Programming" />
        <category scheme="http://www.sixapart.com/ns/types#category" term="Rails" />
        
        <category scheme="http://sixapart.com/ns/types#tag" term="rails" />
        <category scheme="http://sixapart.com/ns/types#tag" term="rails cookie-based session storage" />
        <category scheme="http://sixapart.com/ns/types#tag" term="session-storage" />
        
<content type="html" xml:lang="en-US" xml:base="http://www.chasingsparks.com/">
&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;p&gt;I used &lt;a href=&quot;http://www.rubyonrails.org/&quot;&gt;Rails 2.0&lt;/a&gt; as part of my &lt;a href=&quot;http://www.chasingsparks.com/2008/01/starting-an-onl.html&quot;&gt;recent startup venture&lt;/a&gt; (actually, I started with 1.2.3 but migrated 2 days after the new release).&amp;nbsp; The &lt;a href=&quot;http://ryandaigle.com/articles/2007/2/21/what-s-new-in-edge-rails-cookie-based-sessions&quot;&gt;cookie-based session storage&lt;/a&gt; was my primary motivation for using the latest release before it has been hardened by wide deployment.&amp;nbsp; Cookie-based session storage is sexy.&amp;nbsp; They appropriately move session storage to the user through the utilization of HMAC.&amp;nbsp; In other words, no scalability bottlenecks will be imposed because of PStore and ActiveRecord sessions.&lt;/p&gt;

&lt;p&gt;While the decision to make Cookie-Based session storage the default session storage engine in Rails 2.0 still seems to be a bit controversial, the benefits, assuming security is maintained, are incredible.&amp;nbsp; In my venture, I used sessions in a way that many developers would find dangerous.&amp;nbsp; My venture was a dating website targeted to large metropolitan areas, each with it&#39;s own sub-domain.&amp;nbsp; The website emphasized finding people to go on a date with in real-time.&amp;nbsp; Offline users were not browsable. Users were grouped by metro shard: New York City residents would go to the nyc sub-domain, Philadelphia residents would go to the philly sub-domain, etc.&amp;nbsp; All of the user&#39;s profile information and messages was stored on server pointed to by the primary domain, but once logged in and ready to interact, the user would be dispatched to the appropriate shard. &lt;/p&gt;

&lt;p&gt;Here&#39;s where things get…unique. Instead of doing MySQL replication to each shard, each shard had its own, unshared database.&amp;nbsp; When a user decided to interact in a specific metro area, the user clicked a form, disguised as a hyperlink, which submitted their encrypted profile to the appropriate shard. &lt;/p&gt;

&lt;p&gt;For example, if the user wanted to find a date in Uptown Manhattan, they would click the Uptown Manhattan link, which did a post to the nyc shard, Uptown Manhattan homepage, sending the encrypted profile silently along.&amp;nbsp; The nyc shard then checked for tampering, decrypted the profile, and stored it in it&#39;s local memory only database.&amp;nbsp; If the user had had been idle for too long the profile was marked as stale, and a chron job would sweep it away shortly thereafter.&lt;/p&gt;

&lt;p&gt;This technique is only worthwhile if there is something that can be sharded but there are clear benefits. The main server handled all permanent changes to the user&#39;s data (including message sending) but this was done via posts and redirects.&amp;nbsp; The main server and each shard were completely decoupled.&amp;nbsp; They did not, at any point, communicate with each other.&amp;nbsp; Obviously, this makes for a very scalable website.&lt;/p&gt;

&lt;p&gt;I should note that by using this technique I was committing the dual sin of premature optimization and abuse of something cool for the sake of messing around.&amp;nbsp; That makes me dumb.&amp;nbsp; My point is, if you have a mature project that is running into scalability constraints but has a possibility for sharding, this technique could be valuable (or at least cool).&lt;/p&gt;&lt;/div&gt;
</content>


    </entry>
    <entry>
        <title>List people</title>
        <link rel="alternate" type="text/html" href="http://www.chasingsparks.com/2008/01/list-people.html" />
        <link rel="replies" type="text/html" href="http://www.chasingsparks.com/2008/01/list-people.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-43965822</id>
        <published>2008-01-10T09:15:43-08:00</published>
        <updated>2008-01-10T09:15:56-08:00</updated>
        <summary>I explore why my previous aversion to list people was dumb.</summary>
        <author>
            <name>John Nelson</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Productivity" />
        
        <category scheme="http://sixapart.com/ns/types#tag" term="list people" />
        <category scheme="http://sixapart.com/ns/types#tag" term="lists" />
        <category scheme="http://sixapart.com/ns/types#tag" term="productivity" />
        
<content type="html" xml:lang="en-US" xml:base="http://www.chasingsparks.com/">
&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;p&gt;We all know list people. They enumerate every task and derive great satisfaction from being able to mark an item as complete.&amp;nbsp; I have, in the past, looked down upon list people.&amp;nbsp; I thought their obsession with lists was a personality flaw that inhibited them from being able to work on-the-fly.&amp;nbsp; Recently, as anyone who reads this blog might know, I have been reevaluating all of my premises given the &lt;a href=&quot;http://www.chasingsparks.com/2008/01/starting-an-onl.html&quot;&gt;failure of my recent startup venture&lt;/a&gt;.&amp;nbsp; I think my aversion to, and view of, list people was one of my faulty premises.&lt;/p&gt;

&lt;p&gt;Part of that realization stemmed from a conversation that resulted in a blinding rage.&amp;nbsp; A friend of mine was trying to convince me that you can not learn from books.&amp;nbsp; She said you can only learn by doing, and books are just noise.&amp;nbsp; I read obsessively because of an agreement I have with Sir Francis Bacon.&amp;nbsp; Part of her reason for saying this might have been because the conversation was political, and as we were on different sides of the issue, she was personally attacking me.&amp;nbsp; It happens.&amp;nbsp; Anyway, to defend my view of books I not-so-calmly tried to explain to her that people who hold such a viewpoint read books passively.&amp;nbsp; If you are not continuously evaluating and challenging what the author is saying, then yes, a book&#39;s value is greatly reduced (as is reading only books you agree with before reading).&amp;nbsp; If you read a book actively, taking time to devour new points of view while being able to call “Bullshit”, then a book is a learning device with incredible bandwidth.&amp;nbsp; I read actively. &lt;/p&gt;

&lt;p&gt;This brings me back to my misunderstanding of lists as a practical tool.&amp;nbsp; If you use a list as a passive device, it is of little value.&amp;nbsp; It just enhances what may be a rigid personality.&amp;nbsp; Alternatively, if you use a list as an active device there is a great benefit.&amp;nbsp; For example, I have always scoffed at things like an &lt;a href=&quot;http://evhead.com/2005/11/ten-rules-for-web-startups.asp&quot;&gt;Entrepreneurial Check List&lt;/a&gt; because I thought they were offensive to creativity. I was wrong. If you actively evaluate your idea/project against a check list with the intention of challenging your own assumptions, you will be more likely to succeed.&amp;nbsp; Again, if you&#39;re a rigid person and use such a list as a passive tool, as in “my idea must pass every test”, it&#39;s just silly whereas if you use it to question the validity of your own ideas, it&#39;s incredibly valuable. &lt;/p&gt;

&lt;p&gt;Fixed faulty assumption…&lt;em&gt;check&lt;/em&gt;.&lt;/p&gt;&lt;/div&gt;
</content>


    </entry>
    <entry>
        <title>AdWords Traffic Estimator Inaccuracies</title>
        <link rel="alternate" type="text/html" href="http://www.chasingsparks.com/2008/01/adwords-traffic.html" />
        <link rel="replies" type="text/html" href="http://www.chasingsparks.com/2008/01/adwords-traffic.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-43934006</id>
        <published>2008-01-09T15:41:28-08:00</published>
        <updated>2008-01-09T15:44:53-08:00</updated>
        <summary>I mentioned in a previous post that AdWords can give you misleading estimates of both available traffic and CPC pricing. Before initializing a campaign I used the Google AdWords traffic estimate tool. The following is a partial screenshot of it&#39;s...</summary>
        <author>
            <name>John Nelson</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Marketing" />
        
        <category scheme="http://sixapart.com/ns/types#tag" term="adwords" />
        <category scheme="http://sixapart.com/ns/types#tag" term="google" />
        <category scheme="http://sixapart.com/ns/types#tag" term="marketing" />
        <category scheme="http://sixapart.com/ns/types#tag" term="ppc" />
        
<content type="xhtml" xml:lang="en-US" xml:base="http://www.chasingsparks.com/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>I mentioned in a previous post that <a href="http://adwords.google.com/">AdWords</a> can give you misleading estimates of both available traffic and CPC pricing. Before initializing a campaign I used the Google AdWords traffic
estimate tool. The following is a partial screenshot of it's estimation.</p>

<p><a href="http://chasingsparks.typepad.com/.shared/image.html?/photos/uncategorized/2008/01/09/full_estimate.gif" onclick="window.open(this.href, '_blank', 'width=773,height=594,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img width="100" height="76" border="0" alt="Full_estimate" title="Full_estimate" src="http://www.chasingsparks.com/images/2008/01/09/full_estimate.gif" style="margin: 0px 5px 5px 0px;" /></a></p>

<p>As show, given a CPC rate of $0.12 and a daily budget of $10.00, I
would receive all the clicks I requested. Satisfied, I created a new
AdWords campaign and inputed the exact same parameters (both were
targeted to the US alone). To my surprise the results were very
different.</p>

<p><a onclick="window.open(this.href, '_blank', 'width=770,height=598,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://chasingsparks.typepad.com/.shared/image.html?/photos/uncategorized/2008/01/09/nil_estimate.gif"><img width="100" height="77" border="0" src="http://www.chasingsparks.com/images/2008/01/09/nil_estimate.gif" title="Nil_estimate" alt="Nil_estimate" style="margin: 0px 5px 5px 0px;" /></a></p>

<p>Okay, wait...0 predicted clicks? At the top of the page there was an explanation for the discrepancy.</p>

<p><a href="http://chasingsparks.typepad.com/.shared/image.html?/photos/uncategorized/2008/01/09/nil_explaination.gif" onclick="window.open(this.href, '_blank', 'width=646,height=182,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img width="100" height="28" border="0" alt="Nil_explaination" title="Nil_explaination" src="http://www.chasingsparks.com/images/2008/01/09/nil_explaination.gif" style="margin: 0px 5px 5px 0px;" /></a> </p>

<p>The fact that I had never had a campaign meant my estimates would be
rough. Makes sense but wouldn't account for 0 clicks. The next bullet
point did. Only Google's search result ads are included in the
in-campaign estimator. I assumed Google would deliver ads as predicted
by the traffic estimator tool but since it was in the campaign, they
didn't indicate estimates of the content network.<br /><br />Unfortunately,
only a few clicks ever came through. I emailed Google but their
response was vague. If it was another company I would suggest it was a
form of baiting. On the other hand, I wouldn't accuse Google of poor
programming.<br /><br />The deviation is greater when you target a geographically expensive area (e.g. New York City). From the looks of it, they are using the system-wide average instead of geographic average resulting in a gross underestimation of cost.
</p></div>
</content>


    </entry>
    <entry>
        <title>Starting an Online Dating Network</title>
        <link rel="alternate" type="text/html" href="http://www.chasingsparks.com/2008/01/starting-an-onl.html" />
        <link rel="replies" type="text/html" href="http://www.chasingsparks.com/2008/01/starting-an-onl.html" thr:count="1" thr:updated="2008-04-05T22:44:20-07:00" />
        <id>tag:typepad.com,2003:post-43932090</id>
        <published>2008-01-09T14:49:17-08:00</published>
        <updated>2008-01-09T16:59:41-08:00</updated>
        <summary>My experience failing to start a successful online dating network.</summary>
        <author>
            <name>John Nelson</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Entrepreneurship" />
        
        <category scheme="http://sixapart.com/ns/types#tag" term="Entrepreneurship" />
        <category scheme="http://sixapart.com/ns/types#tag" term="metcalfs law" />
        <category scheme="http://sixapart.com/ns/types#tag" term="online dating" />
        <category scheme="http://sixapart.com/ns/types#tag" term="undercapitalization" />
        
<content type="html" xml:lang="en-US" xml:base="http://www.chasingsparks.com/">
&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;p&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;(My experience with &lt;a href=&quot;http://tryst.com/&quot;&gt;Tryst.com&lt;/a&gt;)&lt;/span&gt;&lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;&lt;br /&gt;&lt;br /&gt;Dollar Bills Ya’ll&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://plentyoffish.wordpress.com/&quot;&gt;Markus Frind&#39;s&lt;/a&gt; free online dating website, &lt;a href=&quot;http://plentyoffish.com/&quot;&gt;Plenty Of Fish&lt;/a&gt;, earns around five million dollars a year in advertising revenue.&amp;nbsp; &lt;a href=&quot;http://conru.com/&quot;&gt;Andrew Conru&#39;s&lt;/a&gt; &lt;a href=&quot;http://www.friendfinderinc.com/&quot;&gt;FriendFinder Inc&lt;/a&gt; was recently bought by &lt;a href=&quot;http://www.pmgi.com/&quot;&gt;Penthouse&lt;/a&gt; for &lt;a href=&quot;http://www.nytimes.com/2007/12/12/technology/12penthouse.html?ex=1355115600&amp;amp;en=f07c66cc612cde60&amp;amp;ei=5090&amp;amp;partner=rssuserland&amp;amp;emc=rss&quot;&gt;$500,000,000&lt;/a&gt;. &lt;a href=&quot;http://www.spark.net/default.htm&quot;&gt;SparkNetworks&lt;/a&gt;, of &lt;a href=&quot;http://www.jdate.com/&quot;&gt;JDate&lt;/a&gt; and &lt;a href=&quot;http://www.americansingles.com/&quot;&gt;American Singles&lt;/a&gt;
fame, is on the market in the $100,000,000 area. Obviously, I was
attracted to the online dating industry because of the proven profit
potential. People are willing to pay for online dating.&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;Metcalf’s Law&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Unfortunately,
I learned through failure that this profit is hard earned. Let&#39;s
pretend that you have created an algorithm that is 100% efficient at
matching people. In other words, if the algorithm matches you, it has
mathematically found your soul mate. This is all well and good but you
are still bound by geography. Clearly, if the algorithm matches a
person in Guam to a person in Brooklyn it is of no value. Even the
person who is completely dedicated to finding their supposed soul mate
is not likely to travel more than 50 miles.&lt;/p&gt;

&lt;p&gt;On the other hand,
let&#39;s say you don&#39;t claim to match users but only offer the ability to
search by whatever criteria you find important. This is roughly what
Markus Frind does. His website might not be flashy or use unnecessarily
complicated math, but it has claim to a tremendous set of users.
Additionally, with the exception of age, gender, sexuality, education,
and appearance, most factors are going to be garbage in, garbage out.&lt;/p&gt;

&lt;p&gt;The
important thing to note is that in both cases, match making and
browsable profiles, the websites value is derived from the size of its
user base. &lt;a href=&quot;http://en.wikipedia.org/wiki/Metcalfe%27s_law&quot;&gt;Metcalfe&#39;s Law&lt;/a&gt;
is a bitch. While I, like many people, was attracted to online dating
because of its proven profit potential, I misread the costs of entry.
Programming, hosting, and bandwidth are all so negligible that they are
not really relevant. The advertising dollars needed to reach a minimum
level of geographical saturation are extremely high and often
overlooked. In the beginning, given the low conversion rate resulting
from a low saturation, you are not going to feed AdWords and earn a
profit. In other words, my mistake was the oft repeated one of
under-capitalization. Unless you have a brilliant idea combined with a
bit of luck or say, a couple hundred thousand dollars in burnable cash,
an online dating venture is unlikely to succeed.&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;A History of My Projects (learn from my mistakes)&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Version 1&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The
first version of Tryst was targeted to American users with no part of
the site externally visible – as in viewable without login – except for
the tour and signup page. The concept was to have a Craigslist style
dating network where users posted “Trysts” (dates they want to go on).
There was no free tour. The website converted terribly (read: no
users). Clearly, if the user is going to pay for an online dating
website, they expect a free tour because nearly every website offers
one. No matter how good an offer may appear, there should be a free
tour.&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Version 2&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Realizing
that the advertising costs needed to reach a decent saturation of users
was going to be well beyond my budget, I set out on creating a free,
advertising supported network that could be fed by search engine hits.
Again, I was interested in creating an “I want to go on this date”
oriented network, as it was at least, an underdeveloped area in the
online dating industry. The search results did slowly advance but after
two months I was only earning around $10.00 a day in advertising.&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Version 3&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Discouraged
by the slow growth of Tryst Version 2 and apprehensive about the
possibility of a bubble in PPC advertising, I set out to create Tryst
version 3. This version was also tried to create real world dates, but
in a different way. Users would login and be presented with only online
users that matched the gender, sexuality, and age group they were
interested in. They could then send messages back and forth in an
instant message / conversational way. This version was not free but did
have a form of baiting. You could see the profiles of other members,
but you could not message them unless you had a paying account. Free
members could respond to messages sent by paying members, but they
could not initiate the conversation.&lt;/p&gt;

&lt;p&gt;This version actually had a
high visitor to free member rate (between 20 – 35%). Unfortunately, my
estimates of the CPC costs for Google’s geographically targeted
visitors were erroneous. I was assuming (using Google&#39;s estimator tool)
a PPC rate of between 40 cents and 1 dollar. At this rate, I also
assumed I could expect several hundred visitors per day, per city (also
from the traffic estimator tool). In reality, targeting NYC costs a
minimum of around $1 CPC and, more alarmingly, generated only a couple
clicks a day. Tryst version 3, like versions 1 and two, could not work.&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;Advice borne of failure&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;The
barriers to entry in the only dating industry are, in fact, very high.
You are in a race to acquire new users before your old users are
discouraged. Until you reach a certain point of saturation, you are
going to be burning advertising bucks.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Do not base
your costs on one set of estimations. I used only AdWords&#39;s Traffic
Estimator tool which severely underestimated the CPC and available
traffic leaving no chance of success with my chosen business model.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Do
you really want to make an online dating website? I really had no
interest but was attracted by the low entry cost and proven
profitability. I found both assumptions to be false and more
importantly, because I wasn’t interested in solving any problems in
online dating, had little continuing motivation.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;If
you do decide to start Yet Another Online Dating Website, be original!
PlentyOfFish created a free network for online dating when the industry
had none. EHarmony was one of the first networks to offer comprehensive
matching (aka voodoo but still). I believe the future in online dating
is going to be more real world date centric. Find ways (and funding) to
get people out and dating with people they could potentially enjoy.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;
</content>


    </entry>
 
</feed>
<!-- ph=1 -->
<!-- nhm:from_kauri -->
