<?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>life.i.think</title>
	<atom:link href="http://lukewarmtapioca.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lukewarmtapioca.com</link>
	<description>lukewarmtapioca.com</description>
	<lastBuildDate>Mon, 01 Dec 2008 03:02:26 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='lukewarmtapioca.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/9eb610b396936d35c63bfbaf7c76ef92?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>life.i.think</title>
		<link>http://lukewarmtapioca.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://lukewarmtapioca.com/osd.xml" title="life.i.think" />
	<atom:link rel='hub' href='http://lukewarmtapioca.com/?pushpress=hub'/>
		<item>
		<title>Why I Loathe the Word &#8216;Microblogging&#8217;</title>
		<link>http://lukewarmtapioca.com/2008/06/09/why-i-loathe-the-word-microblogging/</link>
		<comments>http://lukewarmtapioca.com/2008/06/09/why-i-loathe-the-word-microblogging/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 20:22:00 +0000</pubDate>
		<dc:creator>Britt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukewarmtapioca.com/2008/06/09/why-i-loathe-the-word-microblogging</guid>
		<description><![CDATA[Twitter is often referred to as &#8216;microblogging.&#8217; I&#8217;ve never liked this word that has been created around the format, and I finally realized how to put this distaste down on {virtual} paper. This is a misrepresentation at the service for several reasons:
1) A twitter is really nothing like a small blog post. Blog posts are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4249&subd=lukewarmtapioca&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Twitter is often referred to as &#8216;microblogging.&#8217; I&#8217;ve never liked this word that has been created around the format, and I finally realized how to put this distaste down on {virtual} paper. This is a misrepresentation at the service for several reasons:</p>
<p>1) <span style="font-size:1.3em;color:#8e6402;font-family:georgia;margin-top:10px;"><i>A twitter is really nothing like a small blog post.</i></span> Blog posts are often very pre-meditated. Twitter posts are most frequently off-the-top-of-your-head blurbs.</p>
<p>2) <span style="font-size:1.3em;color:#8e6402;font-family:georgia;margin-top:10px;"><i>Twitter has a greater impact on your person as a whole.</i></span> While blogs were and are a revolutionary medium that allows people to write and be read, as mentioned in my last post Twitter actually changes the way you interact with others around you on a day-to-day basis. I&#8217;m more connected with those around me, as well as it providing a window into the lives of people who are geographically distant.</p>
<p>Evaluating these concepts and others similar one thing becomes clear &#8230;</p>
<h2><i>Twitter <span class="caps">IS NOT SMALL BLOGGING</span>!</i></h2>
<p>They both provide a mechanism to broadcast text on the web. <span style="font-size:1.3em;color:#8e6402;font-family:georgia;margin-top:10px;"><i>So does <span class="caps">IRC</span>.</i></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lukewarmtapioca.wordpress.com/4249/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lukewarmtapioca.wordpress.com/4249/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lukewarmtapioca.wordpress.com/4249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lukewarmtapioca.wordpress.com/4249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lukewarmtapioca.wordpress.com/4249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lukewarmtapioca.wordpress.com/4249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lukewarmtapioca.wordpress.com/4249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lukewarmtapioca.wordpress.com/4249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lukewarmtapioca.wordpress.com/4249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lukewarmtapioca.wordpress.com/4249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lukewarmtapioca.wordpress.com/4249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lukewarmtapioca.wordpress.com/4249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4249&subd=lukewarmtapioca&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/2008/06/09/why-i-loathe-the-word-microblogging/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/42f25d242aa8d725758481bfd04f3278?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Britt</media:title>
		</media:content>
	</item>
		<item>
		<title>What is Twitter to Me?</title>
		<link>http://lukewarmtapioca.com/2008/05/30/what-is-twitter-to-me/</link>
		<comments>http://lukewarmtapioca.com/2008/05/30/what-is-twitter-to-me/#comments</comments>
		<pubDate>Fri, 30 May 2008 07:21:00 +0000</pubDate>
		<dc:creator>Britt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukewarmtapioca.com/2008/05/30/what-is-twitter-to-me</guid>
		<description><![CDATA[I&#8217;ve been thinking about this quite a bit lately, especially after several discussions with people around the topic at SxSW. It&#8217;s a subject of particular interest to be because I find it easy to verbalize but hard to convey digitally, especially within one&#8217;s attention span. As Amy Hoy recently said &#8230; &#8220;Brevity is the soul [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4233&subd=lukewarmtapioca&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:1.3em;color:#8e6402;font-family:georgia;margin-top:10px;"><i>I&#8217;ve been thinking about this quite a bit lately,</i></span> especially after several discussions with people around the topic at SxSW. It&#8217;s a subject of particular interest to be because I find it easy to verbalize but hard to convey digitally, especially within one&#8217;s attention span. As <a href="http://slash7.com">Amy Hoy</a> recently said &#8230; &#8220;Brevity is the soul of twit.&#8221;</p>
<p><span style="font-size:1.3em;color:#8e6402;font-family:georgia;margin-top:10px;"><i>When I first came out to San Francisco</i></span><br />
to visit <a href="http://overstimulate.com">Jesse</a>, a long time friend, I hadn&#8217;t planned on taking a job. In fact, my plan was to move from Lexington to South America. It would take a great bit to divert me from my chosen path, and to my surprise, diverted I was.</p>
<p><span style="font-size:1.3em;color:#8e6402;font-family:georgia;margin-top:10px;"><i>For a long time I&#8217;ve found great value in &#8216;the little things.&#8217; </i></span> Smiling at someone on the street, having a small conversation at the line at the market, dot, dot, dot. These are the things from which we build our character, our <strong>selves</strong>. We take the little things we see in each other that touch a particular emotion and absorb them into our own personas. I saw this potential within Twitter, except on an immensely greater scale. Of note, at the time I wasn&#8217;t &#8216;into&#8217; social networks. The only one I even belonged to was Flickr. I had no MySpace or Facebook, but this little thing called Twitter somehow stuck me as different. A small chord that played and whispered: I do not replicate or improve on what has already been. I am revolution.</p>
<h3 style="font-size:2em;font-weight:bold;margin-bottom:30px;"><i>Revolution (n): a drastic and far-reaching change in ways of thinking and behaving.</i></h3>
<p><span style="font-size:1.3em;color:#8e6402;font-family:georgia;margin-top:10px;"><i>I&#8217;ve now been working on Twitter for the better part of a year and a half.</i></span> Interestingly, it&#8217;s become a posterchild for the discussion of scaling social internet architecture, yet what I have found equally as interesting is the <strong>social</strong> implications that have emerged. Something unexpected. Something new. Twitter changes the way I interact with people on some fundamental level! I have friends that both are, and are not on Twitter. The ways in which I communicate with them are actually beginning to differ. I should note that this is not negative, but there is a divergence. Twitter provides so much context into people&#8217;s lives. I know things that people are doing and thinking that I wouldn&#8217;t otherwise, either because they were too small to bring up in conversation, or weren&#8217;t appropriate to bring up in a later encounter based on time passed. Plus, we have way to many little things happening in our lives to discuss them all with others.</p>
<p><span style="font-size:1.3em;color:#8e6402;font-family:georgia;margin-top:10px;"><i>Enter Twitter.</i></span> I find myself framing conversations based on <strong>microcontext</strong> { not to be confused with microbloging, which is a word I loathe }. These bits of personal information, these Twitters. Suddenly I find I have much more personal context around a conversation that might otherwise diverge to one of those &#8220;So, how are things?&#8221; interactions. This is a drastic and fundamental change in the way in which we communicate. All the little things! The smiles. The laughs. The tears. Walking the dog. Feeding your cat. Eating a banana. Having a baby. These are what Twitter are to me.</p>
<p><i>
<div style="font-size:1.3em;color:#8e6402;font-family:georgia;margin-top:10px;">postscript.</div>
<p><span style="color:#8e8672;">It&#8217;s funny that within all the debate and negativity surrounding how to scale a platform, it&#8217;s the underlying ideals of Twitter, not the technical implications, that are truly important. These are the things that will survive and ultimately make our lives better. People get so swept up in the technical work, that they miss the little details that are so wonderfully important. Isn&#8217;t that the embodiment of what Twitter is all about?</span></i></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lukewarmtapioca.wordpress.com/4233/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lukewarmtapioca.wordpress.com/4233/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lukewarmtapioca.wordpress.com/4233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lukewarmtapioca.wordpress.com/4233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lukewarmtapioca.wordpress.com/4233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lukewarmtapioca.wordpress.com/4233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lukewarmtapioca.wordpress.com/4233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lukewarmtapioca.wordpress.com/4233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lukewarmtapioca.wordpress.com/4233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lukewarmtapioca.wordpress.com/4233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lukewarmtapioca.wordpress.com/4233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lukewarmtapioca.wordpress.com/4233/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4233&subd=lukewarmtapioca&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/2008/05/30/what-is-twitter-to-me/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/42f25d242aa8d725758481bfd04f3278?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Britt</media:title>
		</media:content>
	</item>
		<item>
		<title>Ruby GetText Memory Leaks</title>
		<link>http://lukewarmtapioca.com/2008/05/23/ruby-gettext-memory-leaks/</link>
		<comments>http://lukewarmtapioca.com/2008/05/23/ruby-gettext-memory-leaks/#comments</comments>
		<pubDate>Fri, 23 May 2008 02:35:00 +0000</pubDate>
		<dc:creator>Britt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukewarmtapioca.com/2008/05/23/ruby-gettext-memory-leaks</guid>
		<description><![CDATA[Today I was working on some revisions to Twitter&#8217;s Protected User stack { or Project: PrivateParts as I like to refer to it in my head }, when I had to make some string changes to emails being sent to users. Offhandedly, I ran across this bug report on RubyForge.
HOLY HELL IN A HANDBASKET!
The Ruby [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4225&subd=lukewarmtapioca&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Today I was working on some revisions to Twitter&#8217;s Protected User stack { or Project: PrivateParts as I like to refer to it in my head }, when I had to make some string changes to emails being sent to users. Offhandedly, I ran across <a href="http://rubyforge.org/tracker/index.php?func=detail&#38;aid=18392&#38;group_id=855&#38;atid=3377">this bug report</a> on RubyForge.</p>
<h1><span class="caps">HOLY HELL IN A HANDBASKET</span>!</h1>
<p>The Ruby GetText 1.90.0 gem uses an instance of a Class Object as a key to a hash! <a href="http://www.ruzee.com/">Steven Rusitschka</a> noticed this and noted that <i><a href="http://www.ruzee.com/blog/2008/03/memory-leaks-in-gettext-for-ruby-on-rails/">&#8220;the memory Mongrel used increased by 1 MB with each request it served &#8230;&#8221;</a></i></p>
<p>To avoid any possibility of a reader absentmindedly skipping over that last quote from Steven, I present it for you again in <span style="color:red;">vibrant color</span> and with <strong>extra bold</strong>.</p>
<h1 style="font-weight:bold;color:red;"><i>&#8220;the memory Mongrel used increased by 1 MB with each request it served &#8230;&#8221;</i></h1>
<p>Okay. Deep breaths. Before everyone goes around MonkeyPatching GetText, there&#8217;s a new release out, 1.91.0. Let&#8217;s look and see if a fix has been put into place.</p>
<h3>Old: 1.90.0</h3>
<pre><code>
def bound_target(klass = self) # :nodoc:
  if cached?
    if @@__cache_bound_target[klass] # &lt;---- Yowza!
      return @@__cache_bound_target[klass]
    end
  end

  ret = nil
  if klass.kind_of? Class or klass.kind_of? Module
    ret = klass
  else
    ret = klass.class
  end
  ret = GetText if ret.name =~ /^\#&lt;|^$/
  @@__cache_bound_target[klass] = ret
  ret
end
</pre>
<p></code></p>
<h3>New: 1.91.0</h3>
<pre><code>
def bound_target(klass = self) # :nodoc:
  id = klass.object_id
  if cached?
   tgt = @@__cache_bound_target[id] # &lt;---- Ahhh, much better.
   return tgt if tgt
  end

  ret = (klass.kind_of? Module) ? klass : klass.class
  if ret.name =~ /^\#&lt;|^$/ or ret == GetText
     #GC for dead object_ids.
     ret = Object
     if @@__cache_bound_target.size &gt; CACHE_BOUND_TARGET_MAX_SIZE
        @@__cache_bound_target.clear
     end
  end
  @@__cache_bound_target[id] = ret
  ret
end
</pre>
<p></code></p>
<p>The GetText gem is now using the object_id as the cache key. To say the least, this has made a huge difference in the memory profile of Twitter&#8217;s Mongrels. Not much more to say here. If you&#8217;re running GetText with Rails and are find yourself a bit leaky, check your gem version. You may be due for an upgrade!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lukewarmtapioca.wordpress.com/4225/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lukewarmtapioca.wordpress.com/4225/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lukewarmtapioca.wordpress.com/4225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lukewarmtapioca.wordpress.com/4225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lukewarmtapioca.wordpress.com/4225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lukewarmtapioca.wordpress.com/4225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lukewarmtapioca.wordpress.com/4225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lukewarmtapioca.wordpress.com/4225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lukewarmtapioca.wordpress.com/4225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lukewarmtapioca.wordpress.com/4225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lukewarmtapioca.wordpress.com/4225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lukewarmtapioca.wordpress.com/4225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4225&subd=lukewarmtapioca&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/2008/05/23/ruby-gettext-memory-leaks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/42f25d242aa8d725758481bfd04f3278?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Britt</media:title>
		</media:content>
	</item>
		<item>
		<title>GetText, Rails, Authentication, Japanese Firefox, Setting the Language Manually</title>
		<link>http://lukewarmtapioca.com/2008/05/14/gettext-rails-authentication-japanese-firefox-setting-the-language-manually/</link>
		<comments>http://lukewarmtapioca.com/2008/05/14/gettext-rails-authentication-japanese-firefox-setting-the-language-manually/#comments</comments>
		<pubDate>Wed, 14 May 2008 10:46:00 +0000</pubDate>
		<dc:creator>Britt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukewarmtapioca.com/2008/05/14/gettext-rails-authentication-japanese-firefox-setting-the-language-manually</guid>
		<description><![CDATA[There occurs an interesting problem when you are using Ruby&#8217;s GetText to translate a site that requires authentication.
Most likely, you have a before_filter that calls a method that authenticates the user for certain methods. Within this filter you probably have something like:

user = (attempt_oauth or
  attempt_basic_auth or
  attempt_session_auth or
  attempt_cookie_auth or
  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4202&subd=lukewarmtapioca&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>There occurs an interesting problem when you are using Ruby&#8217;s GetText to translate a site that requires authentication.</p>
<p>Most likely, you have a before_filter that calls a method that authenticates the user for certain methods. Within this filter you probably have something like:</p>
<pre><code>
user = (attempt_oauth or
  attempt_basic_auth or
  attempt_session_auth or
  attempt_cookie_auth or
  (@authentication_attempt = nil))
</code></pre>
<p>If the user has clicked &#8220;Remember Me&#8221; and stored an cookie locally, than we&#8217;re going to validate the user using attempt_cookie_auth. But what if the user has a default language set (stored most likely in the database). We&#8217;ll assume there is a method user.lang that returns the default language or nil.</p>
<p>Your first attempt at setting this here may be this one.</p>
<h3 style="color:red;padding-left:1em;padding-right:1em;"><span class="caps">NOTE</span>: THIS <span class="caps">IS WRONG</span>!</h3>
<pre><code>
# If the user has a default lang, set it here.
if u &#38;&#38; u.lang &#38;&#38; (LANGUAGE_CODES.include?(u.lang))
  cookies[:lang] = u.lang unless cookies[:lang]
end
</code></pre>
<p>That sets the cookie for the user, but the GetText stack has already been invoked, so the language will be that sent over by the browser. Refreshing the page will cause GetText to pick up the cookie value and render the proper language.</p>
<p>Next, we try using set_locale (GetText.set_locale) to set the language manually, which seems like a perfectly reasonable option.</p>
<h3 style="color:red;padding-left:1em;padding-right:1em;"><span class="caps">NOTE</span>: THIS <span class="caps">IS WRONG</span>!</h3>
<pre><code>
# If the user has a default lang, set it here.
if u &#38;&#38; u.lang &#38;&#38; (LANGUAGE_CODES.include?(u.lang))
  cookies[:lang] = u.lang unless cookies[:lang]
  set_locale u.lang
end
</code></pre>
<p>Why is this bad? The set_locale method persists for the life of the Ruby instance (in this case, Mongrel), not the session. This means that there will be a literal battle for contention over which language to use.</p>
<pre><code>
User A sets the language to JA and the page renders JA.
User B sets the language to EN and the page renders JA.
User A sets the language to JA and the page renders EN.
</code></pre>
<p>You see the problem! We want a clean slate at the beginning of each request so GetText has no pre-conceived notions about what the language should be. Hrm &#8230; let&#8217;s try something.</p>
<h3 style="color:red;padding-left:1em;padding-right:1em;"><span class="caps">NOTE</span>: THIS <span class="caps">IS WRONG</span>!</h3>
<pre><code>
# If the user has a default lang, set it here.
if u &#38;&#38; u.lang &#38;&#38; (LANGUAGE_CODES.include?(u.lang))
  cookies[:lang] = u.lang unless cookies[:lang]
  set_locale u.lang
else
  set_locale nil
end
</code></pre>
<p>Note &#8230; to be thorough, and because the authentication stack is not called for all methods, we also add this in our application.rb</p>
<pre><code>
  before_init_gettext :set_default_locale
  def set_default_locale; set_locale nil; end
</code></pre>
<p>Here, everything seems to work!<br />
We can even write a test to verify that the contention above doesn&#8217;t occur.</p>
<pre><code>
def test_lang_should_be_set_on_a_per_session_basis
  bob.lang = 'ja'
  assert bob.save
  bob.reload

  assert_equal 'ja', bob.lang
  post '/sessions', {:username_or_email =&gt; bob.screen_name, :password =&gt; 'foo'}
  assert_response :redirect
  follow_redirect!
  assert_response :redirect
  follow_redirect!
  assert_response :success
  assert_equal 'ja', Locale.current.language

  phoenix.reload
  assert_equal nil, phoenix.lang
  post '/sessions', {:username_or_email =&gt; phoenix.screen_name, :password =&gt; 'foo'}
  assert_response :redirect
  follow_redirect!
  assert_response :redirect
  follow_redirect!
  assert_response :success
  assert_equal 'en', Locale.current.language
end
</code></pre>
<p>But alas, download the Japanese version of Firefox and visit the page.</p>
<p><img src="http://farm3.static.flickr.com/2234/2492153756_c47d8ff859_o.jpg" alt="" /></p>
<p>The browser is hungry for <span class="caps">UTF</span>-8 data. As you can see, the part of the page in which we set the locale manually using set_locale is being pushed as <span class="caps">SHIFT</span>-JIS. The blue highlighted area is actually outside of the application.rb controller stack, so is sent via GetText&#8217;s default assumptions: <span class="caps">UTF</span>-8.</p>
<p>But this isn&#8217;t a problem in Safari or Internet Explorer. Why? Let&#8217;s look at the value of <span class="caps">HTTP</span>_ACCEPT_LANGUAGE.</p>
<pre><code>
Firefox :   "HTTP_ACCEPT_CHARSET" =&gt; "EUC-KR,utf-8;q=0.7,*;q=0.7"
Safari  :   "HTTP_ACCEPT_CHARSET" =&gt;  ???
</code></pre>
<p>Safari actually doesn&#8217;t pass one, while Firefox gives precedence <span class="caps">EUC</span>-KR (effectively <span class="caps">SHIFT</span>-JIS) over <span class="caps">UTF</span>-8.</p>
<p>Sigh. Things are looking grim. Back to the drawing board. Let&#8217;s look at the order of precedence for how  the Rails GetText  integration determines the langauge.</p>
<pre><code>
The language passed to GetText.bindtextdomain.
The lang query param. ( url?lang=foo )
The lang cookie.
The value of HTTP_ACCEPT_LANGUAGE passed by the browser.
The default (English).
</code></pre>
<p>Aha! GetText.bindtextdomain! Looking at the RDocs and source, this is not only called within the init_gettext method, but can be set on a per session basis without mucking with default language settings!</p>
<p>Let&#8217;s try!</p>
<h3 style="color:green;padding-left:1em;padding-right:1em;"><span class="caps">NOTE</span>: THIS <span class="caps">IS CORRECT</span>! CELEBRATE!</h3>
<pre><code>
# If the user has a default lang, set it here.
if u &#38;&#38; u.lang &#38;&#38; (LANGUAGE_CODES.include?(u.lang))
  cookies[:lang] = u.lang unless cookies[:lang]
  GetText.bindtextdomain("Twitter", :locale =&gt; u.lang)
end
</code></pre>
<p>So finally, we can set the language on a request manually after the GetText stack has already been invoked. Whew!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lukewarmtapioca.wordpress.com/4202/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lukewarmtapioca.wordpress.com/4202/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lukewarmtapioca.wordpress.com/4202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lukewarmtapioca.wordpress.com/4202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lukewarmtapioca.wordpress.com/4202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lukewarmtapioca.wordpress.com/4202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lukewarmtapioca.wordpress.com/4202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lukewarmtapioca.wordpress.com/4202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lukewarmtapioca.wordpress.com/4202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lukewarmtapioca.wordpress.com/4202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lukewarmtapioca.wordpress.com/4202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lukewarmtapioca.wordpress.com/4202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4202&subd=lukewarmtapioca&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/2008/05/14/gettext-rails-authentication-japanese-firefox-setting-the-language-manually/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/42f25d242aa8d725758481bfd04f3278?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Britt</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2234/2492153756_c47d8ff859_o.jpg" medium="image" />
	</item>
		<item>
		<title>Scripting CONSTANTS in environment.rb {rails}</title>
		<link>http://lukewarmtapioca.com/2008/03/26/scripting-constants-in-environment-rb-rails/</link>
		<comments>http://lukewarmtapioca.com/2008/03/26/scripting-constants-in-environment-rb-rails/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 22:56:00 +0000</pubDate>
		<dc:creator>Britt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukewarmtapioca.com/2008/03/26/scripting-constants-in-environment-rb-rails</guid>
		<description><![CDATA[You can script the declaration of constants easily enough with Module#const_set.
Sometimes you want to do this from environment.rb when you are loading the Rails stack. It&#8217;s not immediately clear which module this is encapsulated in. Turns out it&#8217;s not contained within anything specifically &#8230; just plain ol&#8217; Object.

foo.each do &#124;bar&#124;
  Object.const_set("CONSTANTLY_#{bar.upcase}", 42)
end

   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4097&subd=lukewarmtapioca&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>You can script the declaration of constants easily enough with Module#const_set.</p>
<p>Sometimes you want to do this from environment.rb when you are loading the Rails stack. It&#8217;s not immediately clear which module this is encapsulated in. Turns out it&#8217;s not contained within anything specifically &#8230; just plain ol&#8217; Object.</p>
<pre><code>
foo.each do |bar|
  Object.const_set("CONSTANTLY_#{bar.upcase}", 42)
end
</code></pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lukewarmtapioca.wordpress.com/4097/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lukewarmtapioca.wordpress.com/4097/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lukewarmtapioca.wordpress.com/4097/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lukewarmtapioca.wordpress.com/4097/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lukewarmtapioca.wordpress.com/4097/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lukewarmtapioca.wordpress.com/4097/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lukewarmtapioca.wordpress.com/4097/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lukewarmtapioca.wordpress.com/4097/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lukewarmtapioca.wordpress.com/4097/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lukewarmtapioca.wordpress.com/4097/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lukewarmtapioca.wordpress.com/4097/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lukewarmtapioca.wordpress.com/4097/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4097&subd=lukewarmtapioca&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/2008/03/26/scripting-constants-in-environment-rb-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/42f25d242aa8d725758481bfd04f3278?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Britt</media:title>
		</media:content>
	</item>
		<item>
		<title>Trailing Whitespace in Textmate</title>
		<link>http://lukewarmtapioca.com/2008/03/26/trailing-whitespace-in-textmate/</link>
		<comments>http://lukewarmtapioca.com/2008/03/26/trailing-whitespace-in-textmate/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 22:27:00 +0000</pubDate>
		<dc:creator>Britt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://lukewarmtapioca.com/2008/03/26/trailing-whitespace-in-textmate</guid>
		<description><![CDATA[So yes, it&#8217;s true. I&#8217;ve been using Textmate lately. I&#8217;m still using Debian and the trusty Thinkpad (and eyeballing the sexy X300), but also have picked up a MacBook Air, and am dabbling in the world of Mate.
One thing that has bothered me about my typing in Mate (other than the lack of using modes) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4096&subd=lukewarmtapioca&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>So yes, it&#8217;s true. I&#8217;ve been using Textmate lately. I&#8217;m still using Debian and the trusty Thinkpad (and eyeballing the sexy <span class="caps">X300</span>), but also have picked up a MacBook Air, and am dabbling in the world of Mate.</p>
<p>One thing that has bothered me about my typing in Mate (other than the lack of using modes) is that something I&#8217;m doing is leaving trailing whitespace. This, of course, is a problem. Eventually I&#8217;ll figure out what muscle memory reflex is causing this, but there are a few things I&#8217;ve found along the way to help identify these vile and unnecessary bytes in my documents.</p>
<h2>Add Syntax Highlighting for Trailing Whitespaces</h2>
<p>First we must at a rule to match trailing spaces in our language of choice.<br />
{<b>Q:</b> Can we do this for all languages?}</p>
<p style="text-align:center;"><img src="http://lukewarmtapioca.com/assets/2008/3/26/Bundle_Editor-1-1.jpg" alt="" /></p>
<p>Secondly, assign a color to this property in your theme of choice.</p>
<p style="text-align:center;"><img src="http://lukewarmtapioca.com/assets/2008/3/26/Fonts___Colors.jpg" alt="" /></p>
<h2>Keyboard Shortcut to Remove all Trailing Whitespaces</h2>
<p>TextMate comes with a command to remove all trailing spaces from a document. Why not assign a keyboard shortcut to it?<br />
{<b>Q:</b> I&#8217;d love to do this on-save of all documents.}</p>
<p style="text-align:center;"><img src="http://lukewarmtapioca.com/assets/2008/3/26/Bundle_Editor-2-1.jpg" alt="" /></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lukewarmtapioca.wordpress.com/4096/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lukewarmtapioca.wordpress.com/4096/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lukewarmtapioca.wordpress.com/4096/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lukewarmtapioca.wordpress.com/4096/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lukewarmtapioca.wordpress.com/4096/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lukewarmtapioca.wordpress.com/4096/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lukewarmtapioca.wordpress.com/4096/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lukewarmtapioca.wordpress.com/4096/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lukewarmtapioca.wordpress.com/4096/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lukewarmtapioca.wordpress.com/4096/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lukewarmtapioca.wordpress.com/4096/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lukewarmtapioca.wordpress.com/4096/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4096&subd=lukewarmtapioca&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/2008/03/26/trailing-whitespace-in-textmate/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/42f25d242aa8d725758481bfd04f3278?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Britt</media:title>
		</media:content>

		<media:content url="http://lukewarmtapioca.com/assets/2008/3/26/Bundle_Editor-1-1.jpg" medium="image" />

		<media:content url="http://lukewarmtapioca.com/assets/2008/3/26/Fonts___Colors.jpg" medium="image" />

		<media:content url="http://lukewarmtapioca.com/assets/2008/3/26/Bundle_Editor-2-1.jpg" medium="image" />
	</item>
		<item>
		<title>A Better GMail Labeling System</title>
		<link>http://lukewarmtapioca.com/2007/11/17/a-better-gmail-labeling-system/</link>
		<comments>http://lukewarmtapioca.com/2007/11/17/a-better-gmail-labeling-system/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 09:17:00 +0000</pubDate>
		<dc:creator>Britt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukewarmtapioca.com/2007/11/17/a-better-gmail-labeling-system</guid>
		<description><![CDATA[The other day Cameron and I were talking about a better way of labeling and prioritizing your mail in GMail. It is a system of his friend&#8217;s devise, who&#8217;s name I&#8217;ve forgotten (I&#8217;ll update this when I get it.)
The system is simply to create 4 labels, and then apply filters to the emails you receive [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4020&subd=lukewarmtapioca&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>The other day <a href="http://twitter.com/ceedub">Cameron</a> and I were talking about a better way of labeling and prioritizing your mail in GMail. It is a system of his friend&#8217;s devise, who&#8217;s name I&#8217;ve forgotten (I&#8217;ll update this when I get it.)</p>
<p>The system is simply to create 4 labels, and then apply filters to the emails you receive on a regular basis.</p>
<p><img src="http://lukewarmtapioca.com/assets/2007/11/17/labels.png" alt="" /></p>
<p>1. Now <i>(Mail you need to look at <span class="caps">RIGHT NOW</span>!)</i><br />
2. Soon <i>(Mail that you should probably read by the end of the day)</i><br />
3. Later <i>(Mail to read when you find that free time you&#8217;ve been looking for)</i><br />
4. Never <i>( <strong>crickets</strong> .. I mean maybe you might want to read them &#8230; sometime &#8230;)</i></p>
<p>So for example, Twitter direct messages auto go to Now. An email about that fancy pants party you&#8217;re going to in 2 days would go under Soon. Facebook messages would be filed under Later. Financial statements might go to Never.</p>
<p>It&#8217;s important that you preface the words (Now, &#8230;) with numbers so GMail orders them properly.<br />
This works fantastically with <a href="http://twitter.com/mihai">Mihai Parparita</a>&#8217;s wonderful <a href="http://blog.persistent.info/2007/11/macros-for-new-version-of-gmail.html">GMail Macros</a> Greasemonkey script.</p>
<p><b>Update:</b> The aforementioned friend who devised this brilliant scheme is <a href="http://twitter.com/TeddyG">Ted Grubb</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lukewarmtapioca.wordpress.com/4020/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lukewarmtapioca.wordpress.com/4020/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lukewarmtapioca.wordpress.com/4020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lukewarmtapioca.wordpress.com/4020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lukewarmtapioca.wordpress.com/4020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lukewarmtapioca.wordpress.com/4020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lukewarmtapioca.wordpress.com/4020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lukewarmtapioca.wordpress.com/4020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lukewarmtapioca.wordpress.com/4020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lukewarmtapioca.wordpress.com/4020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lukewarmtapioca.wordpress.com/4020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lukewarmtapioca.wordpress.com/4020/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=4020&subd=lukewarmtapioca&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/2007/11/17/a-better-gmail-labeling-system/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/42f25d242aa8d725758481bfd04f3278?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Britt</media:title>
		</media:content>

		<media:content url="http://lukewarmtapioca.com/assets/2007/11/17/labels.png" medium="image" />
	</item>
		<item>
		<title>Back from RailsConfEurope07</title>
		<link>http://lukewarmtapioca.com/2007/09/26/back-from-railsconfeurope07/</link>
		<comments>http://lukewarmtapioca.com/2007/09/26/back-from-railsconfeurope07/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 18:39:00 +0000</pubDate>
		<dc:creator>Britt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukewarmtapioca.com/2007/09/26/back-from-railsconfeurope07</guid>
		<description><![CDATA[5 1/2 hour train from Heidelburg to Berlin.
Arrived at the closed Tegel Airport at 1 AM and sat on a bench till they opened at 4 AM. 
Waited for 7:30 AM flight to London. 
Layover, and then ~12 hour flight to San Diego. 
Through customs and flight to San Jose. 
Bus to Cal Train Station.
 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=3892&subd=lukewarmtapioca&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>5 1/2 hour train from <strong>Heidelburg</strong> to <strong>Berlin</strong>.<br />
Arrived at the <strong>closed</strong> Tegel Airport at 1 AM and sat on a bench till they opened at 4 AM. <br />
Waited for 7:30 AM flight to <strong>London</strong>. <br />
Layover, and then ~12 hour flight to <strong>San Diego</strong>. <br />
Through customs and flight to <strong>San Jose</strong>. <br />
Bus to <strong>Cal Train Station</strong>.<br />
 1 1/2 hour Cal Train to the <strong>Bart Station</strong>. <br />
Bart to <strong>24 and Guerrero</strong>.<br />
Home! <strong>Whew!</strong> What a ride.</p>
<p>Germany was absolutely beautiful. The conference was a blast, and had the best food I&#8217;ve ever had at a lunch break. The talk went well I think, and you can see the slides, which have a few cool rails tricks embedded, here:</p>
<p><a href="http://www.slideshare.net/britt/a-small-talk-on-getting-big-113066"><img src="http://lukewarmtapioca.com/assets/2007/9/26/railsconfeuslideimg.jpg" alt="" /></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lukewarmtapioca.wordpress.com/3892/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lukewarmtapioca.wordpress.com/3892/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lukewarmtapioca.wordpress.com/3892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lukewarmtapioca.wordpress.com/3892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lukewarmtapioca.wordpress.com/3892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lukewarmtapioca.wordpress.com/3892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lukewarmtapioca.wordpress.com/3892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lukewarmtapioca.wordpress.com/3892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lukewarmtapioca.wordpress.com/3892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lukewarmtapioca.wordpress.com/3892/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lukewarmtapioca.wordpress.com/3892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lukewarmtapioca.wordpress.com/3892/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=3892&subd=lukewarmtapioca&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/2007/09/26/back-from-railsconfeurope07/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/42f25d242aa8d725758481bfd04f3278?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Britt</media:title>
		</media:content>

		<media:content url="http://lukewarmtapioca.com/assets/2007/9/26/railsconfeuslideimg.jpg" medium="image" />
	</item>
		<item>
		<title>s.rb: X60, Compiz, &amp; Xrandr.</title>
		<link>http://lukewarmtapioca.com/2007/07/17/s-rb-x60-compiz-xrandr/</link>
		<comments>http://lukewarmtapioca.com/2007/07/17/s-rb-x60-compiz-xrandr/#comments</comments>
		<pubDate>Tue, 17 Jul 2007 02:17:00 +0000</pubDate>
		<dc:creator>Britt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukewarmtapioca.com/2007/07/17/s-rb-x60-compiz-xrandr</guid>
		<description><![CDATA[Continuing with Ruby scripts that should probably be written in Bash, here&#8217;s one for the eyecandy inclined.
Situation:

You are running an X stack that supports xrandr 1.2.
You are running Compiz (Fusion).
You want to switch back and forth between an external monitor, and your laptop&#8217;s display.

A couple of notes. Unfortunately, you cannot trigger an xrandr script on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=3731&subd=lukewarmtapioca&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Continuing with Ruby scripts that should probably be written in Bash, here&#8217;s one for the eyecandy inclined.</p>
<p><strong>Situation:</strong></p>
<ul>
<li>You are running an X stack that supports xrandr 1.2.</li>
<li>You are running Compiz (Fusion).</li>
<li>You want to switch back and forth between an external monitor, and your laptop&#8217;s display.</li>
</ul>
<p>A couple of notes. Unfortunately, you cannot trigger an xrandr script on <span class="caps">VGA</span> plug/unplug events (yet). See <a href="http://lists.freedesktop.org/archives/xorg/2007-July/026236.html">this post</a>. Also, if you are not running an accelerated desktop, or your 2 monitors fit within the bounds defined by a few X components (<a href="http://lists.freedesktop.org/pipermail/xorg/2007-March/022913.html">see this post</a>), you can use your laptop as a secondary monitor.</p>
<p>For now, I&#8217;m just toggling between my two monitors via this small Ruby script.</p>
<pre><code>
#!/usr/bin/env ruby

def lappy; exec "xrandr --output VGA --off --output LVDS --auto";  end
def external; exec "xrandr --output LVDS --off --output VGA --auto"; end

case ARGV.first
  when 'l' then lappy
  when 'e' then external
  else
    external if `xrandr -q`.include?('VGA connected')
    lappy
  end
</code></pre>
<p><a href="http://lukewarmtapioca.com/assets/2007/7/17/s">Download</a>.</p>
<p>And before all you MacHeads out there smile to yourselves about all this work; You thought I forgot about you! I so vary rarely tinker with my desktop setup. This truly is the oddity! Oh, and <a href="http://twitter.com/blaine/statuses/153159902">http://twitter.com/blaine/statuses/153159902</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lukewarmtapioca.wordpress.com/3731/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lukewarmtapioca.wordpress.com/3731/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lukewarmtapioca.wordpress.com/3731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lukewarmtapioca.wordpress.com/3731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lukewarmtapioca.wordpress.com/3731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lukewarmtapioca.wordpress.com/3731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lukewarmtapioca.wordpress.com/3731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lukewarmtapioca.wordpress.com/3731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lukewarmtapioca.wordpress.com/3731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lukewarmtapioca.wordpress.com/3731/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lukewarmtapioca.wordpress.com/3731/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lukewarmtapioca.wordpress.com/3731/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=3731&subd=lukewarmtapioca&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/2007/07/17/s-rb-x60-compiz-xrandr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/42f25d242aa8d725758481bfd04f3278?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Britt</media:title>
		</media:content>
	</item>
		<item>
		<title>f.rb: An awk script.</title>
		<link>http://lukewarmtapioca.com/2007/07/12/f-rb-an-awk-script/</link>
		<comments>http://lukewarmtapioca.com/2007/07/12/f-rb-an-awk-script/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 22:59:00 +0000</pubDate>
		<dc:creator>Britt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukewarmtapioca.com/2007/07/12/f-rb-an-awk-script</guid>
		<description><![CDATA[Also known as &#8220;the most the most useful piece of software [someone else] wrote in [a] calendar year,&#8221; rewritten.
Today Mark Dominus blogged about f, a wholly fantastic and tiny Perl script that changes:
ps aux &#124; awk &#8216;{print $2}&#8217; to ps aux &#124; f 2.
Of course there&#8217;s the deeply embedded urge of every geek to take [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=3721&subd=lukewarmtapioca&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Also known as &#8220;the most the most useful piece of software [someone else] wrote in [a] calendar year,&#8221; rewritten.</p>
<p>Today <a href="http://blog.plover.com/">Mark Dominus</a> blogged about <a href="http://blog.plover.com/prog/runN.html"><strong>f</strong></a>, a wholly fantastic and tiny Perl script that changes:</p>
<p><strong>ps aux | awk &#8216;{print $2}&#8217;</strong> to <strong>ps aux | f 2</strong>.</p>
<p>Of course there&#8217;s the deeply embedded urge of every geek to take something like this and reproduce it in all possible languages (plus there was a syntax error running the Perl script on my end), so here we have it in Ruby!</p>
<pre><code>
#!/usr/bin/ruby

($stderr.print "f.rb usage: fieldnumber\n"; exit) if ARGV.empty?
$stdin.each { |l| puts l.split[ARGV.first.to_i-1] }
</code></pre>
<p><a href="http://lukewarmtapioca.com/assets/2007/7/12/f">Download</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lukewarmtapioca.wordpress.com/3721/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lukewarmtapioca.wordpress.com/3721/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lukewarmtapioca.wordpress.com/3721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lukewarmtapioca.wordpress.com/3721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lukewarmtapioca.wordpress.com/3721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lukewarmtapioca.wordpress.com/3721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lukewarmtapioca.wordpress.com/3721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lukewarmtapioca.wordpress.com/3721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lukewarmtapioca.wordpress.com/3721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lukewarmtapioca.wordpress.com/3721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lukewarmtapioca.wordpress.com/3721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lukewarmtapioca.wordpress.com/3721/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lukewarmtapioca.com&blog=593181&post=3721&subd=lukewarmtapioca&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/2007/07/12/f-rb-an-awk-script/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/42f25d242aa8d725758481bfd04f3278?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Britt</media:title>
		</media:content>
	</item>
	</channel>
</rss>