<?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/"
	>

<channel>
	<title>written by Britt Selvitelle</title>
	<atom:link href="http://lukewarmtapioca.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lukewarmtapioca.com</link>
	<description>lukewarmtapioca.com</description>
	<lastBuildDate>Tue, 15 Jun 2010 07:57:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Loading Google Maps V3 Asynchronously</title>
		<link>http://lukewarmtapioca.com/loading-google-maps-v3-asynchronously/</link>
		<comments>http://lukewarmtapioca.com/loading-google-maps-v3-asynchronously/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 09:03:41 +0000</pubDate>
		<dc:creator>Britt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://lukewarmtapioca.com/?p=4253</guid>
		<description><![CDATA[6 Second Summary Async loading of Google Maps V3 REQUIRES a callback in order to operate correctly. The Devil&#8217;s in the Details The Google Maps V3 Loader is a strange beast, to say the least. There&#8217;s also very little documentation on how it works at the time of writing this, and that which is available [...]]]></description>
			<content:encoded><![CDATA[<h3>6 Second Summary</h3>
<p>Async loading of Google Maps V3 REQUIRES a callback in order to operate correctly.</p>
<h3>The Devil&#8217;s in the Details</h3>
<p>The Google Maps V3 Loader is a strange beast, to say the least. There&#8217;s also very little documentation on how it works at the time of writing this, and that which is available is either inaccurate or incomplete.</p>
<p>Firstly, <a href="http://http://code.google.com/apis/maps/faq.html#loadasync">Google&#8217;s own example code</a> simply doesn&#8217;t work with V3, contrary to their docs.</p>
<p>[javascript]<br />
 function loadScript() {<br />
      var script = document.createElement(&#8220;script&#8221;);<br />
      script.type = &#8220;text/javascript&#8221;;<br />
      script.src = &#8220;http://maps.google.com/maps?file=api&amp;v=2&amp;key=&#8230;&amp;async=2&amp;callback=loadMap&#8221;;<br />
      document.body.appendChild(script);<br />
  }<br />
[/javascript]</p>
<p>This uses the http://maps.google.com/maps?file=api&amp;v=2 entrypoint which is incompatible with V3.<br />
The appropriate endpoint is http://maps.google.com/maps/api/js, and if you&#8217;re loading synchronously than you&#8217;re done.</p>
<h3>If you&#8217;re loading with your fancy pants, the call <em>REQUIRES A CALLBACK</em>.</h3>
<p>If you don&#8217;t pass in a callback the loader overwrites the document in its entirety.<br />
[javascript]<br />
<script 
  src="http://maps.google.com/maps/api/js?sensor=false" 
  type="text/javascript>
</script></p>
<p>window.google = window.google || {};<br />
google.maps = google.maps || {};<br />
(function() {</p>
<p>  function getScript(src) {<br />
    document.write(&#8221;);<br />
  }<br />
  &#8230;<br />
[/javascript]</p>
<p>But pass a callback (we actually use isNaN) and it appends to the body.</p>
<p>[javascript]<br />
<script 
  src="http://maps.google.com/maps/api/js?sensor=false&#038;callback=isNaN" 
  type="text/javascript>
</script></p>
<p>window.google = window.google || {};<br />
google.maps = google.maps || {};<br />
(function() {</p>
<p>  function getScript(src) {<br />
    var s = document.createElement(&#8216;script&#8217;);</p>
<p>    s.src = src;<br />
    document.body.appendChild(s);<br />
  }<br />
  &#8230;<br />
[/javascript]</p>
<p>Weird.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/loading-google-maps-v3-asynchronously/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Why I Loathe the Word &#039;Microblogging&#039;</title>
		<link>http://lukewarmtapioca.com/why-i-loathe-the-word-microblogging/</link>
		<comments>http://lukewarmtapioca.com/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 [...]]]></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>
<p><i><span style="font-size:1.6em;color:#8e6402;font-family:georgia;margin-top:10px;">Twitter is not small blogging &#8230;</span></i></p>
<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>
]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/why-i-loathe-the-word-microblogging/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>What is Twitter to Me?</title>
		<link>http://lukewarmtapioca.com/what-is-twitter-to-me/</link>
		<comments>http://lukewarmtapioca.com/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 [...]]]></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:1.6em;font-weight:bold;margin-bottom:14px;"><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>
]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/what-is-twitter-to-me/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Ruby GetText Memory Leaks</title>
		<link>http://lukewarmtapioca.com/ruby-gettext-memory-leaks/</link>
		<comments>http://lukewarmtapioca.com/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’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! [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was working on some revisions to Twitter’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&amp;aid=18392&amp;group_id=855&amp;atid=3377">this bug report</a> on RubyForge.</p>
<h3 style="font-size:1.6em;font-weight:bold;margin-bottom:8px;">HOLY HELL IN A HANDBASKET</span>!</h3>
<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 <em><a href="http://www.ruzee.com/blog/2008/03/memory-leaks-in-gettext-for-ruby-on-rails/">“the memory Mongrel used increased by 1 MB with each request it served …”</a></em></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>
<h3 style="font-size:1.6em;font-weight:bold;margin-bottom:8px; color:red">“the memory Mongrel used increased by 1 MB with each request it served …”</em></h3>
<p>Okay. Deep breaths. Before everyone goes around MonkeyPatching GetText, there’s a new release out, 1.91.0. Let’s look and see if a fix has been put into place.</p>
<h3>Old: 1.90.0</h3>
<p>[ruby]<br />
def bound_target(klass = self) # :nodoc:<br />
if cached?<br />
if @@__cache_bound_target[klass] # &lt;&#8212;- Yowza!<br />
return @@__cache_bound_target[klass]<br />
end<br />
end</p>
<p>ret = nil<br />
if klass.kind_of? Class or klass.kind_of? Module<br />
ret = klass<br />
else<br />
ret = klass.class<br />
end<br />
ret = GetText if ret.name =~ /^\#&lt;|^$/<br />
@@__cache_bound_target[klass] = ret<br />
ret<br />
end<br />
[/ruby]</p>
<h3>New: 1.91.0</h3>
<p>[ruby]<br />
def bound_target(klass = self) # :nodoc:<br />
id = klass.object_id<br />
if cached?<br />
tgt = @@__cache_bound_target[id] # &lt;&#8212;- Ahhh, much better.<br />
return tgt if tgt<br />
end</p>
<p>ret = (klass.kind_of? Module) ? klass : klass.class<br />
if ret.name =~ /^\#&lt;|^$/ or ret == GetText<br />
#GC for dead object_ids.<br />
ret = Object<br />
if @@__cache_bound_target.size &gt; CACHE_BOUND_TARGET_MAX_SIZE<br />
@@__cache_bound_target.clear<br />
end<br />
end<br />
@@__cache_bound_target[id] = ret<br />
ret<br />
end<br />
[/ruby]<br />
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’s Mongrels. Not much more to say here. If you’re running GetText with Rails and are find yourself a bit leaky, check your gem version. You may be due for an upgrade!</p>
]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/ruby-gettext-memory-leaks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>GetText, Rails, Authentication, Japanese Firefox, Setting the Language Manually</title>
		<link>http://lukewarmtapioca.com/gettext-rails-authentication-japanese-firefox-setting-the-language-manually/</link>
		<comments>http://lukewarmtapioca.com/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: [ruby] user = (attempt_oauth or attempt_basic_auth or attempt_session_auth or attempt_cookie_auth or (@authentication_attempt [...]]]></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>
<p>[ruby]<br />
user = (attempt_oauth or<br />
  attempt_basic_auth or<br />
  attempt_session_auth or<br />
  attempt_cookie_auth or<br />
  (@authentication_attempt = nil))<br />
[/ruby]</p>
<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>
<p>[ruby]<br />
# If the user has a default lang, set it here.<br />
if u &#38;&#38; u.lang &#38;&#38; (LANGUAGE_CODES.include?(u.lang))<br />
  cookies[:lang] = u.lang unless cookies[:lang]<br />
end<br />
[/ruby]</p>
<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>
<p>[ruby]<br />
# If the user has a default lang, set it here.<br />
if u &#38;&#38; u.lang &#38;&#38; (LANGUAGE_CODES.include?(u.lang))<br />
  cookies[:lang] = u.lang unless cookies[:lang]<br />
  set_locale u.lang<br />
end<br />
[/ruby]</p>
<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>
<p>[plain]<br />
User A sets the language to JA and the page renders JA.<br />
User B sets the language to EN and the page renders JA.<br />
User A sets the language to JA and the page renders EN.<br />
[/plain]</p>
<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>
<p>[ruby]<br />
# If the user has a default lang, set it here.<br />
if u &#38;&#38; u.lang &#38;&#38; (LANGUAGE_CODES.include?(u.lang))<br />
  cookies[:lang] = u.lang unless cookies[:lang]<br />
  set_locale u.lang<br />
else<br />
  set_locale nil<br />
end<br />
[/ruby]</p>
<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>
<p>[ruby]<br />
  before_init_gettext :set_default_locale<br />
  def set_default_locale; set_locale nil; end<br />
[/ruby]</p>
<p>Here, everything seems to work!<br />
We can even write a test to verify that the contention above doesn&#8217;t occur.</p>
<p>[ruby]<br />
def test_lang_should_be_set_on_a_per_session_basis<br />
  bob.lang = &#8216;ja&#8217;<br />
  assert bob.save<br />
  bob.reload</p>
<p>  assert_equal &#8216;ja&#8217;, bob.lang<br />
  post &#8216;/sessions&#8217;, {:username_or_email =&gt; bob.screen_name, :password =&gt; &#8216;foo&#8217;}<br />
  assert_response :redirect<br />
  follow_redirect!<br />
  assert_response :redirect<br />
  follow_redirect!<br />
  assert_response :success<br />
  assert_equal &#8216;ja&#8217;, Locale.current.language</p>
<p>  phoenix.reload<br />
  assert_equal nil, phoenix.lang<br />
  post &#8216;/sessions&#8217;, {:username_or_email =&gt; phoenix.screen_name, :password =&gt; &#8216;foo&#8217;}<br />
  assert_response :redirect<br />
  follow_redirect!<br />
  assert_response :redirect<br />
  follow_redirect!<br />
  assert_response :success<br />
  assert_equal &#8216;en&#8217;, Locale.current.language<br />
end<br />
[/ruby]</p>
<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>
<p>[plain]<br />
Firefox :   &#8220;HTTP_ACCEPT_CHARSET&#8221; =&gt; &#8220;EUC-KR,utf-8;q=0.7,*;q=0.7&#8243;<br />
Safari  :   &#8220;HTTP_ACCEPT_CHARSET&#8221; =&gt;  ???<br />
[/plain]</p>
<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>
<p>[plain]<br />
The language passed to GetText.bindtextdomain.<br />
The lang query param. ( url?lang=foo )<br />
The lang cookie.<br />
The value of HTTP_ACCEPT_LANGUAGE passed by the browser.<br />
The default (English).<br />
[/plain]</p>
<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>
<p>[ruby]<br />
# If the user has a default lang, set it here.<br />
if u &#38;&#38; u.lang &#38;&#38; (LANGUAGE_CODES.include?(u.lang))<br />
  cookies[:lang] = u.lang unless cookies[:lang]<br />
  GetText.bindtextdomain(&#8220;Twitter&#8221;, :locale =&gt; u.lang)<br />
end<br />
[/ruby]</p>
<p>So finally, we can set the language on a request manually after the GetText stack has already been invoked. Whew!</p>
]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/gettext-rails-authentication-japanese-firefox-setting-the-language-manually/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Scripting CONSTANTS in environment.rb {rails}</title>
		<link>http://lukewarmtapioca.com/scripting-constants-in-environment-rb-rails/</link>
		<comments>http://lukewarmtapioca.com/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. [ruby] foo.each do &#124;bar&#124; Object.const_set(&#8220;CONSTANTLY_#{bar.upcase}&#8221;, 42) [...]]]></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>
<p>[ruby]<br />
foo.each do |bar|<br />
  Object.const_set(&#8220;CONSTANTLY_#{bar.upcase}&#8221;, 42)<br />
end<br />
[/ruby]</p>
]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/scripting-constants-in-environment-rb-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trailing Whitespace in Textmate</title>
		<link>http://lukewarmtapioca.com/trailing-whitespace-in-textmate/</link>
		<comments>http://lukewarmtapioca.com/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 [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/trailing-whitespace-in-textmate/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>A Better GMail Labeling System</title>
		<link>http://lukewarmtapioca.com/a-better-gmail-labeling-system/</link>
		<comments>http://lukewarmtapioca.com/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 [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/a-better-gmail-labeling-system/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Back from RailsConfEurope07</title>
		<link>http://lukewarmtapioca.com/back-from-railsconfeurope07/</link>
		<comments>http://lukewarmtapioca.com/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 [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/back-from-railsconfeurope07/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>s.rb: X60, Compiz, &amp; Xrandr.</title>
		<link>http://lukewarmtapioca.com/s-rb-x60-compiz-xrandr/</link>
		<comments>http://lukewarmtapioca.com/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 [...]]]></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>
<p>[ruby]<br />
#!/usr/bin/env ruby</p>
<p>def lappy; exec &#8220;xrandr &#8211;output VGA &#8211;off &#8211;output LVDS &#8211;auto&#8221;;  end<br />
def external; exec &#8220;xrandr &#8211;output LVDS &#8211;off &#8211;output VGA &#8211;auto&#8221;; end</p>
<p>case ARGV.first<br />
  when &#8216;l&#8217; then lappy<br />
  when &#8216;e&#8217; then external<br />
  else<br />
    external if `xrandr -q`.include?(&#8216;VGA connected&#8217;)<br />
    lappy<br />
  end<br />
[/ruby]</p>
<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>
]]></content:encoded>
			<wfw:commentRss>http://lukewarmtapioca.com/s-rb-x60-compiz-xrandr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->