<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Crusher Development!</title>
	<atom:link href="http://crusherdev.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://crusherdev.wordpress.com</link>
	<description>rails and stuff and the web thing</description>
	<lastBuildDate>Sat, 24 May 2008 21:31:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='crusherdev.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Crusher Development!</title>
		<link>http://crusherdev.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://crusherdev.wordpress.com/osd.xml" title="Crusher Development!" />
	<atom:link rel='hub' href='http://crusherdev.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Adding option columns without killing Active Record</title>
		<link>http://crusherdev.wordpress.com/2008/05/24/adding-option-columns-without-killing-active-record/</link>
		<comments>http://crusherdev.wordpress.com/2008/05/24/adding-option-columns-without-killing-active-record/#comments</comments>
		<pubDate>Sat, 24 May 2008 21:30:52 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[active record]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://crusherdev.wordpress.com/?p=32</guid>
		<description><![CDATA[I just finished implementing the new notification system for our site, which involved adding 15 different new options that our users can customize regarding how they are messaged from crusher. We&#8217;ve learned that the more columns you have in a model, the more memory it takes up and eats away resources. Given that I really [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=32&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just finished implementing the new notification system for our site, which involved adding 15 different new options that our users can customize regarding how they are messaged from crusher.  We&#8217;ve learned that the more columns you have in a model, the more memory it takes up and eats away resources.   Given that I really didn&#8217;t want to be adding 15 new columns to the user table.  What else can you do though?  Then I thought &#8211; hey, why not just have a single integer that holds the 15 new options and store the value in base 3.  Then have each position in the integer represent one of the options.  I went down this route and it ended up working really well (I think).  I have one tiny int that is in base 6, and one medium int that is in base 3 and that holds all the options we need!  Here is the code I ended up writing to pull out the base 3 values :</p>
<div style="background:#f7f8d9;padding:15px;">
<pre>  def base_three_message_digest_value
    self.message_digest_value.to_s(3)
  end

  # get out a specific position in a number for base 3
  def get_message_digest_value_for_position(position)
    if base_three_message_digest_value.length &gt; position then
      value_position = base_three_message_digest_value.length - position - 1
      base_three_message_digest_value[value_position..value_position].to_i
    else
      0
    end
  end

  # set a specific position in a number for base 3
  def set_message_digest_value_for_position(position, value)
    if base_three_message_digest_value.length &gt; position then
      value_position = base_three_message_digest_value.length - position - 1
      new_value = base_three_message_digest_value
      new_value[value_position] = value.to_s
      self.message_digest_value = new_value.to_i(3)
    else
      self.message_digest_value = self.message_digest_value + (value.to_i * (3 ** position))
    end
  end
</pre>
</div>
<p>then to pull out users with a specific value I do something like this :</p>
<div style="background:#f7f8d9;padding:15px;">(SUBSTR(CONV(message_digest_value,10,3),LENGTH(CONV(message_digest_value,10,3)) &#8211; 7,1)) &gt; 0</div>
<p>Has anyone else out there done this?  Am I missing something, or was this actually a good to way to help our user model stay small and reduce the number of db columns?  So far all seems great.</p>
<p><a href="http://crusherdev.files.wordpress.com/2008/05/picture-2.png"><img class="alignnone size-full wp-image-33" src="http://crusherdev.files.wordpress.com/2008/05/picture-2.png?w=400&#038;h=525" alt="" width="400" height="525" /></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crusherdev.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crusherdev.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crusherdev.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crusherdev.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crusherdev.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crusherdev.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crusherdev.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crusherdev.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crusherdev.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crusherdev.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crusherdev.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crusherdev.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crusherdev.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crusherdev.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crusherdev.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crusherdev.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=32&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crusherdev.wordpress.com/2008/05/24/adding-option-columns-without-killing-active-record/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/407f394b5f66648def55df9eea5cccf6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Russell</media:title>
		</media:content>

		<media:content url="http://crusherdev.files.wordpress.com/2008/05/picture-2.png" medium="image" />
	</item>
		<item>
		<title>More performance plus a cast and a :^)</title>
		<link>http://crusherdev.wordpress.com/2007/12/15/more-performance-plus-a-cast-and-a/</link>
		<comments>http://crusherdev.wordpress.com/2007/12/15/more-performance-plus-a-cast-and-a/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 05:23:33 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[cast]]></category>
		<category><![CDATA[muni tracks]]></category>
		<category><![CDATA[one handed typing]]></category>
		<category><![CDATA[rails performance]]></category>

		<guid isPermaLink="false">http://crusherdev.wordpress.com/2007/12/15/more-performance-plus-a-cast-and-a/</guid>
		<description><![CDATA[Don&#8217;t try to gently glide your bike over MUNI tracks, because one time you will mess up and be allowed the pleasure of typing one handed (see picture). Perpendicular is the way to go. bad : === -/:^)\- &#160; /__:^(_.,&#8217;== &#160; ..crash.. &#160; good : &#124;&#124; &#160; &#124;&#124; &#124;&#124; -/:^)\- &#160; -/:^)\- &#124;&#124; &#124;&#124; &#160; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=30&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t try to gently glide your bike over MUNI tracks, because one time you will mess up and be allowed the pleasure of typing one handed (see picture).  Perpendicular is the way to go.</p>
<p>bad :</p>
<table width="271">
<tr>
<td>=== -/:^)\-</td>
<td>&nbsp;</td>
<td>/__:^(_.,&#8217;==</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="center">..crash..</td>
<td>&nbsp;</td>
</tr>
</table>
<p>good :</p>
<table width="269">
<tr>
<td>||</td>
<td colspan="3">&nbsp;</td>
<td>||</td>
</tr>
<tr>
<td>||</td>
<td>-/:^)\-</td>
<td>&nbsp;</td>
<td>-/:^)\-</td>
<td>||</td>
</tr>
<tr>
<td>||</td>
<td>&nbsp;</td>
<td align="center">..no problem..</td>
<td>&nbsp;</td>
<td>||</td>
</tr>
</table>
<p>I&#8217;m also hoping for the universal health care here in SF for all us uninsured earth passengers.</p>
<p>:^) is better than : ) .. and when necessary use the clown hat because Cartman did &lt;@:^)</p>
<p>Lastly .. rails performance boosts. Moral of the story is use :select so your objects aren&#8217;t bloated, avoid functions that filter records in a has_many relationship, and don&#8217;t be shy about selecting out things from joins to avoid code like page.owner.name which will do an extra query to grab the entire user record just for a name.</p>
<p>We had some code like user_page.invitations.yes_replies. Nice and clean, but all invitations are pulled, memory is gobbled away, and then filtered down to the yes replies. Fine for parties with 50 guests, but 1000 guests and monit starts doing more bouncing than we like to see.</p>
<p><img src="http://crusherdev.files.wordpress.com/2007/12/casttyping.png" alt="Typing with one hand" /></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crusherdev.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crusherdev.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crusherdev.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crusherdev.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crusherdev.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crusherdev.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crusherdev.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crusherdev.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crusherdev.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crusherdev.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crusherdev.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crusherdev.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crusherdev.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crusherdev.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crusherdev.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crusherdev.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=30&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crusherdev.wordpress.com/2007/12/15/more-performance-plus-a-cast-and-a/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/407f394b5f66648def55df9eea5cccf6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Russell</media:title>
		</media:content>

		<media:content url="http://crusherdev.files.wordpress.com/2007/12/casttyping.png" medium="image">
			<media:title type="html">Typing with one hand</media:title>
		</media:content>
	</item>
		<item>
		<title>Need to move S3 Buckets or Accounts?</title>
		<link>http://crusherdev.wordpress.com/2007/11/22/need-to-move-s3-buckets-or-accounts/</link>
		<comments>http://crusherdev.wordpress.com/2007/11/22/need-to-move-s3-buckets-or-accounts/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 00:43:56 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[buckets]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[transfer]]></category>

		<guid isPermaLink="false">http://crusherdev.wordpress.com/2007/11/22/need-to-move-s3-buckets-or-accounts/</guid>
		<description><![CDATA[So when crusher first started last year our engineer who was experimenting with S3 decided to open up his own account and use his credit card. Then crush3r.com went live using S3 and his account. For the past 7 months he has been paying our S3 bill, which has been no more than a couple [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=28&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So when crusher first started last year our engineer who was experimenting with S3 decided to open up his own account and use his credit card.  Then crush3r.com went live using S3 and his account.  For the past 7 months he has been paying our S3 bill, which has been no more than a couple dollars.  Then he started doing other projects using his S3 account, so we couldn&#8217;t take his account for crusher use.  So we had this task of taking over our crusher bucket.  Which is what we did last week.   I found that there were no good tools for downloading entire accounts, or uploading, etc .. so I wrote some code using the aws-s3 gem.  It&#8217;s pretty rough code, because I didn&#8217;t spend more than an hour working on it, and I just used script/console to run and didn&#8217;t write the code for any other use other than this one-time port.<br />
Our key structure is formatted as such &#8220;xxxx/xxxx/file_name.blah&#8221;, so every key is guaranteed to have 2 directories.</p>
<p>I substituted all the crush3r specific information with CAPS.  Go, downloads everything to a local machine, and then put uploads it all.  In case it can help you with a starting point, here is the code :</p>
<pre style="background:black none repeat scroll 0 50%;color:green;padding:20px;">
  @@root = "LOCAL_FILE_DIR"
  @@new_bucket = "NEW_BUCKET_NAME"
  def self.go
    require 'aws/s3'
    AWS::S3::Base.establish_connection!(
      :access_key_id =&gt; "OLD_ACCESS_KEY_ID",
      :secret_access_key =&gt; "OLD_SECRET_ACCESS_KEY"
    )
    crusher_bucket = AWS::S3::Bucket.find("OLD_BUCKET_NAME")
    objects = crusher_bucket.objects
    begin
      objects.each do |obj|
        begin
          dirs = obj.key.split("/")
          root = @@root
          (0..(dirs.size-2)).each do |pos|
            FileUtils.mkdir root + dirs[pos] unless File.directory?(root + dirs[pos])
            root = root + "/" + dirs[pos] + "/"
          end
          file_name = "#{@@root}#{obj.key}"
          unless File.exists?(file_name)
            puts "WRITING : #{file_name}"
            open(file_name, 'w') do |file|
              obj.value do |chunk|
                file.write chunk
              end
            end
          else
            # puts "SKIPPING : #{file_name}"
          end
        rescue
          puts "#{obj.key} is messed up"
        end
      end
      objects = crusher_bucket.objects(:marker =&gt; objects.last.key)
    end while objects.size &gt; 0
  end

  def self.put
    require 'aws/s3'
    AWS::S3::Base.establish_connection!(
      :access_key_id =&gt; "NEW_ACCESS_KEY_ID",
      :secret_access_key =&gt; "NEW_SECRET_ACCESS_KEY"
    )
    dirs = ["ARRAY_LIST_OF_LOCAL_DIRS"]
    dirs.each do |dir_name|
      names = Dir.entries(dir_name)
      names.delete_at(0) if names[0] == "."
      names.delete_at(0) if names[0] == ".."
      names.delete_at(0) if names[0] == ".DS_Store"
      left_path = dir_name.gsub(/LOCAL_FILE_DIR/, "")
      names.each do |name|
        begin
          key_name = left_path + name
          unless AWS::S3::S3Object.exists?(key_name, @@new_bucket) then
            AWS::S3::S3Object.store(key_name, open(dir_name + name), @@new_bucket, :access =&gt; :public_read)
            puts "WRITING : #{key_name}"
          else
            # puts "SKIPPING : #{key_name}"
          end
        rescue
          puts "MESSED UP : #{key_name}"
        end
      end
    end
  end</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crusherdev.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crusherdev.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crusherdev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crusherdev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crusherdev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crusherdev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crusherdev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crusherdev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crusherdev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crusherdev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crusherdev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crusherdev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crusherdev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crusherdev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crusherdev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crusherdev.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=28&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crusherdev.wordpress.com/2007/11/22/need-to-move-s3-buckets-or-accounts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/407f394b5f66648def55df9eea5cccf6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Russell</media:title>
		</media:content>
	</item>
		<item>
		<title>Memory over usage is a standard? Really?</title>
		<link>http://crusherdev.wordpress.com/2007/11/08/memory-over-usage-is-a-standard-really/</link>
		<comments>http://crusherdev.wordpress.com/2007/11/08/memory-over-usage-is-a-standard-really/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 19:26:03 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://crusherdev.wordpress.com/2007/11/08/memory-over-usage-is-a-standard-really/</guid>
		<description><![CDATA[So we&#8217;ve finally transitioned over to our new host, EngineYard, and we ran in to some slight snags.  One of them being that our mongrels are overly hungry for memory.  I come from the C++ / C# world so normally I think the solution is to go straight to profiling tools and figure out what&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=27&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So we&#8217;ve finally transitioned over to our new host, EngineYard, and we ran in to some slight snags.  One of them being that our mongrels are overly hungry for memory.  I come from the C++ / C# world so normally I think the solution is to go straight to profiling tools and figure out what&#8217;s going on.  However I was presented with a different solution for our problem that I guess is fine, it just is not something I&#8217;m used to.  That is, when a mongrel becomes to large, simple kill it.  Why not?  So if we have a mongrel that gets out of hand there are a variety of different tools configured on our site that will tell it to die and bring up a new one .. and many people do this .. so problem solved? :-/</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crusherdev.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crusherdev.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crusherdev.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crusherdev.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crusherdev.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crusherdev.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crusherdev.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crusherdev.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crusherdev.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crusherdev.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crusherdev.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crusherdev.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crusherdev.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crusherdev.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crusherdev.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crusherdev.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=27&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crusherdev.wordpress.com/2007/11/08/memory-over-usage-is-a-standard-really/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/407f394b5f66648def55df9eea5cccf6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Russell</media:title>
		</media:content>
	</item>
		<item>
		<title>Flash uploader, why not?</title>
		<link>http://crusherdev.wordpress.com/2007/10/18/flash-uploader-why-not/</link>
		<comments>http://crusherdev.wordpress.com/2007/10/18/flash-uploader-why-not/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 07:27:22 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[bulk]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[uploader]]></category>

		<guid isPermaLink="false">http://crusherdev.wordpress.com/2007/10/18/flash-uploader-why-not/</guid>
		<description><![CDATA[We all knew that we needed some sort of uploader to help with bulk uploading images in our app. The problem is, my engineering experience doesn&#8217;t involve any technology I could use to write a component myself. Which would be fine at a large company, because I would take a month or two, decide on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=25&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We all knew that we needed some sort of uploader to help with bulk uploading images in our app.  The problem is, my engineering experience doesn&#8217;t involve any technology I could use to write a component myself.  Which would be fine at a large company, because I would take a month or two, decide on what technology was best, do some prototyping and then build a component.  When our team consists of 3 people that just isn&#8217;t an option.</p>
<p>Instead I did some research for a couple hours.  Decided to go with flash instead of java.  Found a five year old company that made a <a href="http://www.element-it.com/MultiPowUpload.aspx">flash uploader</a> for $39.  Built the feature out using the demo version.  Shared it with the team to experiment, we all liked it, and that was it.  Now there are most likely better solutions out there, but with around 2 &#8211; 3 days of time we were able to get a great feature that we are happy with that will move us ahead in helping make photo sharing easier on our site.</p>
<p>If any of you RoR people are going to try and use this uploader there were a couple things I had to do:</p>
<p style="border:1px solid #cccccc;margin:5px;padding:5px;">The uploader comes up after an ajax request so it isn&#8217;t on the intial page.  IE did not care for this and threw a bunch of JS errors.  This could have been because of the JS hooks provided by the flash component.  However, hosting the uploader in an iframe fixed that problem and allowed me to continue on.</p>
<p style="border:1px solid #cccccc;margin:5px;padding:5px;">After an image is uploaded to the server there is a JS hook that is called on the client.  I used this hook to send out an ajax request asking for the image that was just uploaded.  This made it so that as each image is uploaded a thumbnail will appear in view on the client.</p>
<p style="border:1px solid #cccccc;margin:5px;padding:5px;">FireFox on the mac causes the uploader to disappear if opacity is used.  So, when the uploader is brought to view I dynamically disable opacity and restore it when uploading is finished.</p>
<p>If anyone has more experience with this I&#8217;d certainly like to hear about it.  Picture is below, and use the site and try it out for yourself <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
<img src="http://crusherdev.files.wordpress.com/2007/10/picture-1.png" alt="photo uploader" /></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crusherdev.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crusherdev.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crusherdev.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crusherdev.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crusherdev.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crusherdev.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crusherdev.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crusherdev.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crusherdev.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crusherdev.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crusherdev.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crusherdev.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crusherdev.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crusherdev.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crusherdev.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crusherdev.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=25&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crusherdev.wordpress.com/2007/10/18/flash-uploader-why-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/407f394b5f66648def55df9eea5cccf6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Russell</media:title>
		</media:content>

		<media:content url="http://crusherdev.files.wordpress.com/2007/10/picture-1.png" medium="image">
			<media:title type="html">photo uploader</media:title>
		</media:content>
	</item>
		<item>
		<title>RoR?  Don&#8217;t forget about script/console :-)</title>
		<link>http://crusherdev.wordpress.com/2007/10/05/ror-dont-forget-about-scriptconsole/</link>
		<comments>http://crusherdev.wordpress.com/2007/10/05/ror-dont-forget-about-scriptconsole/#comments</comments>
		<pubDate>Fri, 05 Oct 2007 16:05:03 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[command window]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[script/console]]></category>

		<guid isPermaLink="false">http://crusherdev.wordpress.com/2007/10/05/ror-dont-forget-about-scriptconsole/</guid>
		<description><![CDATA[When programming javascript Firebug has a console that lets you type in javascript and fire it against an open window. The Tandy TRS-80 command line let me type in basic programs on the fly. I also have faint recollections of having a command window that came in handy with other languages. However, none of these [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=23&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When programming javascript Firebug has a console that lets you type in javascript and fire it against an open window.  The Tandy TRS-80 command line let me type in basic programs on the fly.  I also have faint recollections of having a command window that came in handy with other languages.  However, none of these ever proved incredibly useful for me, or left any strong imprint on my impressionable mind.</p>
<p>That is, until I started working with RoR and was introduced to the script/console.  Hello &#8220;script/console&#8221;, nice to meet you <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   At first it seemed mildly useful, but the other day after a minor hiccup it proved itself extremely helpful.</p>
<p>The biggest thing to make sure and not overlook is the ability to execute commands like this:</p>
<p style="border:1px solid black;background:pink none repeat scroll 0 50%;margin:5px;padding:5px;"> &gt;&gt;user_list = User.find(:all)<br />
&gt;&gt;user_list.each{ |u| u.update_attributes(:is_crazy, true) if u.has_duplicate_phone_numbers? }</p>
<p>I&#8217;ve done a lot of work with databases, but I am by no means a SQL guru.  These 2 lines of code took me under a minute to write and there aren&#8217;t enough users in our system to have to worry about the execution time.  The hiccup we had the other day involved sending out our monthly product mailer.  We managed to have 2 servers that were asked to create mailer messages, so everyone started getting 2 of our product mailers!  Eek!</p>
<p>Not the end of the world, but not so fun.  We shut down the mailer.  1/3 of the mail did not get sent at all, a handful of people only got one mail, and the rest received 2 mails.  So, I needed to enable only 1 mailer for the 1/3 of the people who hadn&#8217;t received any mails, and turn the rest of the records to a failed status.  Thank you script/console.  Literally under 2 minutes I was able to do some command line work and bring the mailer back up.  I&#8217;m slowly moving myself away from directly doing sql, and loving every inch away I get.</p>
<p>You can see our admin interface &#8211; the fails are the duplicate mailers that I automatically failed:<br />
<a href="http://crusherdev.files.wordpress.com/2007/10/picture-5.png" title="show mailer problem"><img src="http://crusherdev.files.wordpress.com/2007/10/picture-5.png" alt="show mailer problem" /></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crusherdev.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crusherdev.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crusherdev.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crusherdev.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crusherdev.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crusherdev.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crusherdev.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crusherdev.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crusherdev.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crusherdev.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crusherdev.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crusherdev.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crusherdev.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crusherdev.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crusherdev.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crusherdev.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=23&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crusherdev.wordpress.com/2007/10/05/ror-dont-forget-about-scriptconsole/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/407f394b5f66648def55df9eea5cccf6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Russell</media:title>
		</media:content>

		<media:content url="http://crusherdev.files.wordpress.com/2007/10/picture-5.png" medium="image">
			<media:title type="html">show mailer problem</media:title>
		</media:content>
	</item>
		<item>
		<title>More fun with caching and memcached</title>
		<link>http://crusherdev.wordpress.com/2007/09/27/more-fun-with-caching-and-memcached/</link>
		<comments>http://crusherdev.wordpress.com/2007/09/27/more-fun-with-caching-and-memcached/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 20:01:21 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[intelligent_fragment_cache]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://crusherdev.wordpress.com/2007/09/27/more-fun-with-caching-and-memcached/</guid>
		<description><![CDATA[For the past couple months we&#8217;ve been running with our home page and an example page cached. Which gave us a terrfic boost &#8211; it was somewhere around 10x more requests/sec on the home page. After running with this for a while we decided to dedicate a week to performance. Specifically trying to speed up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=19&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For the past couple months we&#8217;ve been running with our home page and an example page cached.  Which gave us a terrfic boost &#8211; it was somewhere around 10x more requests/sec on the home page.  After running with this for a while we decided to dedicate a week to performance.  Specifically trying to speed up event pages, listing directories, users stuff pages, and the contact page.  If your mind is ready to sink in to the details, read on! <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><u>Switching to memcached sessions</u><br />
Had to go through some effort to make sure during our rolling upgrade our users don&#8217;t lose their sessions.  I guess we could always schedule downtime, but where&#8217;s the fun in that?</p>
<p><u>Using the model cache portion of <a href="https://rubyforge.org/projects/ifragmentcache/">intelligent fragment cache </a></u><br />
This plug-in intelligently maps models to fragment caches so that when any save or delete occurs on a specific model the correct fragment caches are invalidated.  There is one shortcoming that we came across.  In our contact page, if a user adds a new contact the cache is not invalidated because that new contact was not associated with the original fragment.  So I needed to add code in the after_create method of our contact model to invalidate the proper key.</p>
<p style="border:1px solid black;background:pink none repeat scroll 0 50%;margin:10px;padding:5px;">   after_create :invalidate_fragments  def invalidate_fragments<br />
return unless ActionController::Base.perform_caching<br />
ActionController::Base.fragment_cache_store.delete(&#8220;/account/contacts.body/#{self.owner_id}&#8221;)<br />
end</p>
<p>Then I also realized it wasn&#8217;t clear to me when a model object was &#8220;touched&#8221; and therefore associated with a fragment.  So there were some instances where I had to do things like this:</p>
<p style="border:1px solid black;background:pink none repeat scroll 0 50%;margin:10px;padding:5px;">@component.touch if ActionController::Base.perform_caching</p>
<p>Aside from that all seemed fine and everything is happily caching now.</p>
<p><u>Grr to caching content with small custom messaging fragments</u><br />
Those partial we have where it says something like &#8220;Russell, hello!&#8221; have made it difficult to effectively apply caching.  One more specific area in Crusher with custom messaging is the guest list.  When you invite guests to a party and show them on your page we display a list of all those people along with their pictures, responses, etc&#8230; Each one of those is a partial and if you&#8217;re party is big it takes a bit of time to load.  Each anonymous user when they visit the page is given an &#8220;add photo&#8221; link that overs over their default mug shot.  So, what to do?  I haven&#8217;t spent enough time investigating this yet, but I&#8217;m thinking that I can leverage inline CSS outside of the cached partial to make sure the proper display is shown.  If not that, there may be some possible Javascript trickery, but I try to avoid that stuff.</p>
<p><a href="http://crusherdev.files.wordpress.com/2007/09/comparison.png" title="Compare different user logins"><img src="http://crusherdev.files.wordpress.com/2007/09/comparison.png" alt="Compare different user logins" /></a></p>
<p><u>Excessive calls to the DB with iterating over records</u><br />
I feel like everyone knows about this one.  We did some major clean-ups to ensure that when we iterate over records we weren&#8217;t making those single DB calls for every record.  This involved using the :include portion of the find methods from active record.  The way I debugged this was by watching my console for DB queries, and continually optimizing until the only one left was the big one at the beginning of the request processing.  I&#8217;m not a mysql guru, so maybe there are things we can do with views or stored procedures to speed things up more, but I haven&#8217;t had time to investigate.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crusherdev.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crusherdev.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crusherdev.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crusherdev.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crusherdev.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crusherdev.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crusherdev.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crusherdev.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crusherdev.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crusherdev.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crusherdev.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crusherdev.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crusherdev.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crusherdev.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crusherdev.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crusherdev.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=19&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crusherdev.wordpress.com/2007/09/27/more-fun-with-caching-and-memcached/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/407f394b5f66648def55df9eea5cccf6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Russell</media:title>
		</media:content>

		<media:content url="http://crusherdev.files.wordpress.com/2007/09/comparison.png" medium="image">
			<media:title type="html">Compare different user logins</media:title>
		</media:content>
	</item>
		<item>
		<title>Selenium fun with Internet Explorer and testing elements that toggle</title>
		<link>http://crusherdev.wordpress.com/2007/09/15/selenium-fun-with-internet-explorer-and-testing-elements-that-toggle/</link>
		<comments>http://crusherdev.wordpress.com/2007/09/15/selenium-fun-with-internet-explorer-and-testing-elements-that-toggle/#comments</comments>
		<pubDate>Sat, 15 Sep 2007 08:25:50 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[css attributes]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[selenium]]></category>

		<guid isPermaLink="false">http://crusherdev.wordpress.com/2007/09/15/selenium-fun-with-internet-explorer-and-testing-elements-that-toggle/</guid>
		<description><![CDATA[Selenium may seem like a big overhead, but when you don&#8217;t have a dedicated QA team like us, it is a life saver. Between that, and our functional, unit, and integration tests we manage to cover testing most of the app. However, since it uses JavaScript, and each browser is implemented different, there are some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=16&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Selenium may seem like a big overhead, but when you don&#8217;t have a dedicated QA team like us, it is a life saver.  Between that, and our functional, unit, and integration tests we manage to cover testing most of the app.  However, since it uses JavaScript, and each browser is implemented different, there are some tricks that are required in order to get cross-browser selenium running.</p>
<p>One of them that we use most of the time allows us to enable show/hiding of browser elements and test through selenium that it works.</p>
<p>The trick is to define a css class :</p>
<p style="background:pink none repeat scroll 0 50%;display:inline;padding:10px;">.hidden { display:none; }</p>
<p>Locate the content that needs to be toggled :</p>
<p style="background:pink none repeat scroll 0 50%;display:inline;padding:10px;"> &lt;div id=&#8221;toggle_me&#8221;&gt; content &lt;/div&gt;</p>
<p>Then use this JS onclick for your element that initiates the toggle.  Since we use rails, we use prototype, which has a terrific helper function:</p>
<p style="background:pink none repeat scroll 0 50%;display:inline;padding:10px;"> $(&#8220;toggle_me&#8221;).toggleClassName(&#8220;hidden&#8221;);</p>
<p>The reason it needs to be done that way is because Internet Explorer doesn&#8217;t fully support attributes.  So CSS like this is invalid in IE:</p>
<p style="background:pink none repeat scroll 0 50%;display:inline;padding:10px;"> DIV[style="display:inline;"] { background: yellow; }</p>
<p>Then in selenium the checks will look something like this</p>
<p>check hidden :</p>
<p style="background:pink none repeat scroll 0 50%;display:inline;padding:10px;">verify_element_present &#8220;css=#hidden_options.hidden&#8221;</p>
<p>check visible :</p>
<p style="background:pink none repeat scroll 0 50%;display:inline;padding:10px;">verify_element_not_present &#8220;css=#hidden_options.hidden&#8221;</p>
<p>That&#8217;s it!  This simple thing has saved us lots of pain in making sure we can run Selenium in IE.  If anyone else has some tips, I&#8217;d love to hear them.  We&#8217;ve been having problem after problem trying to get selenium passing using Safari.</p>
<p><a href="http://crusherdev.files.wordpress.com/2007/09/picture-4.png" title="A picture of beautiful selenium"><img src="http://crusherdev.files.wordpress.com/2007/09/picture-4.png" alt="A picture of beautiful selenium" /></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crusherdev.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crusherdev.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crusherdev.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crusherdev.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crusherdev.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crusherdev.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crusherdev.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crusherdev.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crusherdev.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crusherdev.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crusherdev.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crusherdev.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crusherdev.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crusherdev.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crusherdev.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crusherdev.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=16&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crusherdev.wordpress.com/2007/09/15/selenium-fun-with-internet-explorer-and-testing-elements-that-toggle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/407f394b5f66648def55df9eea5cccf6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Russell</media:title>
		</media:content>

		<media:content url="http://crusherdev.files.wordpress.com/2007/09/picture-4.png" medium="image">
			<media:title type="html">A picture of beautiful selenium</media:title>
		</media:content>
	</item>
		<item>
		<title>Some simple tweaks for auto-complete</title>
		<link>http://crusherdev.wordpress.com/2007/09/09/some-simple-tweaks-for-auto-complete/</link>
		<comments>http://crusherdev.wordpress.com/2007/09/09/some-simple-tweaks-for-auto-complete/#comments</comments>
		<pubDate>Sun, 09 Sep 2007 23:29:44 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[scriptaculous]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://crusherdev.wordpress.com/2007/09/09/some-simple-tweaks-for-auto-complete/</guid>
		<description><![CDATA[Ah, yes .. the lovely auto-complete. I can&#8217;t imagine using any program for sending invitations that doesn&#8217;t have a fast way to locate your contacts. Which is exactly why, if you&#8217;re a registered user, when you are inviting guests we use auto-complete to help you quickly locate your contacts. Furthermore we allow tags to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=14&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ah, yes .. the lovely auto-complete.  I can&#8217;t imagine using any program for sending invitations that doesn&#8217;t have a fast way to locate your contacts.  Which is exactly why, if you&#8217;re a registered user, when you are inviting guests we use auto-complete to help you quickly locate your contacts.  Furthermore we allow tags to be assigned to contacts, and those tags show up in the auto-complete as well.  So if you had a friend named &#8220;Joysake Muroo &lt;jmuroo@jjjmmdd.com&gt;&#8221; and a tag &#8220;joyofsakefriends&#8221; when you type in &#8220;sake&#8221; both of them will show up.  Alright, so that&#8217;s the fun part.</p>
<p>We had 2 less fun things (problems) that I found annoying.  The first problem was if you are a keyboard user and on FireFox, and used the up  and down arrows in the auto-complete box when you hit the up arrow the entire window would jump.  Thanks for this scriptaculous <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   So after one evening of getting fed up with this I planned to fix it.  I found a great simple solution.</p>
<p>Open up controls.js, go to the markPrevious function and change the last line to use false instead of true when calling scrollIntoView.</p>
<p>That&#8217;s it.  I assume this line is used to support some corner case that doesn&#8217;t effect us.  I tested all our auto-complete boxes against all our supported browsers and all is good.  Problem #1 solved.</p>
<p>Problem #2.  We also enable auto-complete for registered users to invite other people to a party they&#8217;ve been invited to.  The problem with this is that the invite others box comes up through an ajax request.  This is a problem because no matter what I did I wasn&#8217;t able to get the auto-complete javascript to fire when embedded in a script tag with-in the partial.  There are multiple ways we could have fixed this.  One being, don&#8217;t use ajax, and simply toggle the visibilty of the box when &#8220;invite others&#8221; is clicked, but I wanted to avoid loading the script if the person was just viewing the page.  The solution we went with was when the user clicks in the auto-complete textbox it loads at that moment (onfocus).  I&#8217;m not so excited about this one, but it has been working fine for some weeks now.</p>
<p>So .. go play with our auto-complete and see what you think .. and if you like it then get yourself some scriptaculous <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://crusherdev.files.wordpress.com/2007/09/picture-6.png" title="auto-complete in action"><img src="http://crusherdev.files.wordpress.com/2007/09/picture-6.png" alt="auto-complete in action" /></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crusherdev.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crusherdev.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crusherdev.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crusherdev.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crusherdev.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crusherdev.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crusherdev.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crusherdev.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crusherdev.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crusherdev.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crusherdev.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crusherdev.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crusherdev.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crusherdev.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crusherdev.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crusherdev.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=14&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crusherdev.wordpress.com/2007/09/09/some-simple-tweaks-for-auto-complete/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/407f394b5f66648def55df9eea5cccf6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Russell</media:title>
		</media:content>

		<media:content url="http://crusherdev.files.wordpress.com/2007/09/picture-6.png" medium="image">
			<media:title type="html">auto-complete in action</media:title>
		</media:content>
	</item>
		<item>
		<title>Rapleaf and Upscoop are the latest spam king and queen</title>
		<link>http://crusherdev.wordpress.com/2007/09/04/rapleaf-and-upscoop-spam/</link>
		<comments>http://crusherdev.wordpress.com/2007/09/04/rapleaf-and-upscoop-spam/#comments</comments>
		<pubDate>Tue, 04 Sep 2007 21:50:51 +0000</pubDate>
		<dc:creator>Russell</dc:creator>
				<category><![CDATA[disturbing]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[friendster]]></category>
		<category><![CDATA[myspace]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[rapleaf]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[upscoop]]></category>

		<guid isPermaLink="false">http://crusherdev.wordpress.com/2007/09/04/rapleaf-and-upscoop-spam/</guid>
		<description><![CDATA[Once upon time there was this nice little site called Upscoop, that was pretty interesting. It would scour the e-mail addresses in your gmail/yahoo/etc.. contact list. Then it would show you all the social sites that your contacts belong to. It was pretty fun, and a good way to see what sites people you know [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=10&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Once upon time there was this nice little site called Upscoop, that was pretty interesting.  It would scour the e-mail addresses in your gmail/yahoo/etc.. contact list.  Then it would show you all the social sites that your contacts belong to.  It was pretty fun, and a good way to see what sites people you know are actually using.</p>
<p>This morning my entire gmail contact list was spammed via Rapleaf / Upscoop.</p>
<p>I am sorry to all those people that have e-mailed me via gmail and received this appalling SPAM since I used Upscoop.</p>
<p>This is one reason why we&#8217;ve tried our best to make sure that we e-mail people when it is expected.  Like if you invite someone to a party, we send an e-mail.  We&#8217;d never SPAM your guest list.  This seems like simple common decency.  I wouldn&#8217;t want to put this feeling I have on our users.</p>
<p>I understand that Rapleaf and Upscoop are start-ups, but this is just common decency.  C-O-M-M-O-N .. D-E-C-E-N-C-Y.  They even say on their home page : &#8220;It is more profitable to be ethical.&#8221; ..um, ha ha?</p>
<p>Ok, not that this was engineering related or anything, but I just had to get that out there.</p>
<p>I would suggest avoiding both of these sites.</p>
<p><img src="http://crusherdev.files.wordpress.com/2007/09/upscoopspam.jpg?w=750" alt="Upscoop spamming .." width="750" /></p>
<p>Update:</p>
<p>Since then rapleaf has issued a formal apology.  Should we forgive blatant spammers?  Our court systems don&#8217;t let people off with apologies, I&#8217;m not sure that spamming is one of those forgivable offenses.  Here&#8217;s the blog post : <a href="http://blog.rapleaf.com/2007/09/06/start-ups-privacy-and-being-wrong/">http://blog.rapleaf.com/2007/09/06/start-ups-privacy-and-being-wrong/</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crusherdev.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crusherdev.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crusherdev.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crusherdev.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crusherdev.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crusherdev.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crusherdev.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crusherdev.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crusherdev.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crusherdev.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crusherdev.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crusherdev.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crusherdev.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crusherdev.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crusherdev.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crusherdev.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crusherdev.wordpress.com&amp;blog=1452866&amp;post=10&amp;subd=crusherdev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crusherdev.wordpress.com/2007/09/04/rapleaf-and-upscoop-spam/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/407f394b5f66648def55df9eea5cccf6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Russell</media:title>
		</media:content>

		<media:content url="http://crusherdev.files.wordpress.com/2007/09/upscoopspam.jpg" medium="image">
			<media:title type="html">Upscoop spamming ..</media:title>
		</media:content>
	</item>
	</channel>
</rss>
