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

<channel>
	<title>San Bei Ji</title>
	<atom:link href="http://www.sanbeiji.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sanbeiji.com</link>
	<description>三杯雞 » Three Cup Chicken</description>
	<pubDate>Tue, 06 May 2008 04:31:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Rails Tip No.1: Making datetime_select more appointment-friendly</title>
		<link>http://www.sanbeiji.com/archives/864</link>
		<comments>http://www.sanbeiji.com/archives/864#comments</comments>
		<pubDate>Tue, 06 May 2008 01:30:38 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[Ruby on Rails]]></category>

		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.sanbeiji.com/?p=864</guid>
		<description><![CDATA[This is the first of what I intend to have as an ongoing list of Ruby on Rails programming tips. These are as much for plugging my own memory holes as they are for the general Googlejuice. Each should be a brief illustration of some technique on how to accomplish something in Ruby on Rails [...]]]></description>
			<content:encoded><![CDATA[<p>This is the first of what I intend to have as an ongoing list of Ruby on Rails programming tips. These are as much for plugging my own memory holes as they are for the general Googlejuice. Each should be a brief illustration of some technique on how to accomplish something in Ruby on Rails - probably  in the form of a short code snippet with explanation. I should preface this all by stating that I am by no means an expert on Rails - I&#8217;ve been using it since late 2007 - so any urge to expound upon these thoughts by the Lightning Rails Ninjas™ out there would be most welcome indeed. Please feel free to comment.</p>
<p>The first one I&#8217;d like to present is how to get the <code>datetime_select</code> helper method to be slightly more user-friendly for your garden-variety appointment form.</p>
<p>Consider you have a form set up already for booking appointments. You may have used datetime_select for the start and end times for your form. The default implementation gives you the current date and time as defaults, and each item is rendered as a select menu.</p>
<p>But rarely would you want to do a new appointment on the same day and at at 12:06 PM, right? More often those things are scheduled at least a day in advance, and on the :00, :15, :30, and :45 minute marks. Or at the very least, having five minute increments for the minute menu should help pare down the options and make things simpler. Here&#8217;s an example of how something like this could be accomplished:</p>
<p><code>
<pre>
< %= f.datetime_select :appointment_start,
                       :default => 24.hours.from_now,
                       :minute_step => 5 %>
</pre>
<p></code></p>
<p>For the above example, we have a <code>datetime_select</code> form helper for the <code>appointment_start</code> column in our database. Simple enough - this is probably how a default code snippet would look from say a scaffold generation. Following that, we&#8217;ve passed a couple of extra bits of information to our helper - a default date and time, and a specification on how we should increment the minutes column.</p>
<p><code>:default => 24.hours.from_now</code> does exactly what you&#8217;d expect - sets the default date and time for all the menus ahead one day. You could just as easily say three days from now, four years from now, and so on. And <code>:minute_step => 5</code> gives us the five minute increments that we want. Set it to 15 if you&#8217;d like to pin it down to the :00, :15, :30, and :45 minute marks. Simple!</p>]]></content:encoded>
			<wfw:commentRss>http://www.sanbeiji.com/archives/864/feed</wfw:commentRss>
		</item>
		<item>
		<title>Updated and Upgraded</title>
		<link>http://www.sanbeiji.com/archives/863</link>
		<comments>http://www.sanbeiji.com/archives/863#comments</comments>
		<pubDate>Tue, 08 Apr 2008 06:02:05 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
		
		<category><![CDATA[Blogging]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.sanbeiji.com/?p=863</guid>
		<description><![CDATA[Migrated to WordPress 2.5 this evening, which was a nice and painless upgrade. In the process I discovered an old and useless plugin that had been left turned on, and disabling that pig made my whole site so much faster - it was killing me to find the reason why this thing was so pokey [...]]]></description>
			<content:encoded><![CDATA[<p>Migrated to <a href="http://www.wordpress.org/">WordPress 2.5</a> this evening, which was a nice and painless upgrade. In the process I discovered an old and useless plugin that had been left turned on, and disabling that pig made my whole site so much faster - it was killing me to find the reason why this thing was so pokey before and I can&#8217;t believe I didn&#8217;t see it before.</p>
<p>The new admin interface designed by <a href="http://happycog.com/">Happy Cog</a> is instantly tons more usable. Everything else seems to work fine, including the iPhone happiness.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sanbeiji.com/archives/863/feed</wfw:commentRss>
		</item>
		<item>
		<title>Poppies</title>
		<link>http://www.sanbeiji.com/archives/862</link>
		<comments>http://www.sanbeiji.com/archives/862#comments</comments>
		<pubDate>Sun, 06 Apr 2008 02:43:36 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
		
		<category><![CDATA[Bay Area]]></category>

		<category><![CDATA[Science &#038; Nature]]></category>

		<category><![CDATA[California]]></category>

		<category><![CDATA[photogrpahy]]></category>

		<category><![CDATA[poppies]]></category>

		<category><![CDATA[spring]]></category>

		<category><![CDATA[wildflowers]]></category>

		<guid isPermaLink="false">http://www.sanbeiji.com/archives/862</guid>
		<description><![CDATA[It is a pretty planet on which I live:

Grabbed this shot up on Mt. Diablo today. The wildflowers were off the hook. Really gorgeous out there lately. The poppies were predominant, dotted with other spots of purple, white, and yellow blossoms here and there. The flowers ran rampant down the hillside:

And then in this perfectly [...]]]></description>
			<content:encoded><![CDATA[<p>It is a pretty planet on which I live:</p>
<p><a href="http://www.flickr.com/photos/sanbeiji/2391445108/" title="Poppies by sanbeiji, on Flickr"><img src="http://farm4.static.flickr.com/3165/2391445108_79ef4b7a4f_m.jpg" alt="Poppies" /></a></p>
<p>Grabbed this shot up on Mt. Diablo today. The wildflowers were off the hook. Really gorgeous out there lately. The poppies were predominant, dotted with other spots of purple, white, and yellow blossoms here and there. The flowers ran rampant down the hillside:</p>
<p><a href="http://www.flickr.com/photos/sanbeiji/2390655547/" title="Poppies by sanbeiji, on Flickr"><img src="http://farm4.static.flickr.com/3279/2390655547_7d66b94105_m.jpg" alt="Poppies" /></a></p>
<p>And then in this perfectly bucolic scene, we have the 3 year old, making faces:</p>
<p><a href="http://www.flickr.com/photos/sanbeiji/2390621811/" title="My crazy son, with poppies. by sanbeiji, on Flickr"><img src="http://farm3.static.flickr.com/2220/2390621811_26bb3c34e2_m.jpg" alt="My crazy son, with poppies." /></a></p>
<p><a href="http://www.flickr.com/photos/sanbeiji/2390618963/" title="Mouth by sanbeiji, on Flickr"><img src="http://farm3.static.flickr.com/2298/2390618963_4ddb60e497_m.jpg" alt="Mouth" /></a></p>
<p>Sigh&#8230; <img src='http://www.sanbeiji.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.sanbeiji.com/archives/862/feed</wfw:commentRss>
		</item>
		<item>
		<title>LibraryThing</title>
		<link>http://www.sanbeiji.com/archives/860</link>
		<comments>http://www.sanbeiji.com/archives/860#comments</comments>
		<pubDate>Wed, 12 Mar 2008 04:21:07 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
		
		<category><![CDATA[Books]]></category>

		<category><![CDATA[Currently Reading]]></category>

		<category><![CDATA[knowledge]]></category>

		<category><![CDATA[socialnetworks]]></category>

		<guid isPermaLink="false">http://www.sanbeiji.com/archives/860</guid>
		<description><![CDATA[LibraryThing is one of my favorite web 2.0 sites. As I mentioned in an earlier post, it is Flickr for bookworms. One of my missions is to always have a book that I&#8217;m actively reading - something I keep around with a bookmark in it, reading it whenever I get a chance. Turns out LibraryThing [...]]]></description>
			<content:encoded><![CDATA[<p>LibraryThing is one of my favorite web 2.0 sites. As I mentioned in an earlier post, it is <a href="http://www.sanbeiji.com/archives/705">Flickr for bookworms</a>. One of my missions is to always have a book that I&#8217;m actively reading - something I keep around with a bookmark in it, reading it whenever I get a chance. Turns out LibraryThing is a great way for me to keep a pulse on all of it, if nothing else than to have a visual reminder of what it is I read so that I can stoke some memory of the details for the things I&#8217;ve been learning along the way.</p>
<p>So lately they&#8217;ve added a few new features, and one feature I particularly like is that they added a status feature to indicate what is currently being read. Another feature I discovered recently was the ability to post a list to my weblog, as I&#8217;ll do here (sorry non-JavaScript-enabled clients:)</p>
<blockquote><p><script language="javascript" type="text/javascript" src="http://www.librarything.com/jswidget.php?reporton=sanbeiji&#038;show=recent&#038;header=1&#038;num=10&#038;covers=small&#038;text=all&#038;tag=alltags&#038;amazonassoc=sanbeiji-20&#038;css=1&#038;style=2&#038;version=1">
</script></p></blockquote>
<p>As you can see, not a lot of this is fiction - just technical and theoretical mumbo-jumbo for the most part. It is my hope someday to get over the technology goals I currently have, and start reading something more fun, like some more <a href="http://www.librarything.com/tag/gabriel+garcia+marquez">Marquez</a> or <a href="http://www.librarything.com/tag/lorca">Lorca</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sanbeiji.com/archives/860/feed</wfw:commentRss>
		</item>
		<item>
		<title>Review: Green&#8217;s Gluten Free Beers</title>
		<link>http://www.sanbeiji.com/archives/859</link>
		<comments>http://www.sanbeiji.com/archives/859#comments</comments>
		<pubDate>Fri, 07 Mar 2008 06:06:04 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
		
		<category><![CDATA[Gastronomy]]></category>

		<category><![CDATA[Gluten Intolerance]]></category>

		<guid isPermaLink="false">http://www.sanbeiji.com/archives/859</guid>
		<description><![CDATA[
Beer tasting is back. Yesterday I found Green&#8217;s Beers in stock at the local BevMo. They had three of their varieties: Quest Tripel Blonde, Discovery Amber, and Endeavour Dubbel Dark. At around $5.50 per 500ml bottle, this is not cheap stuff. But as a deprived enthusiast of the craft ale, this is worth the experiment.
Why [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/sanbeiji/2315426415/" title="Green's Beers by sanbeiji, on Flickr"><img src="http://farm3.static.flickr.com/2342/2315426415_60fd82c447_m.jpg" alt="Green's Beers" class="right" /></a></p>
<p>Beer tasting is back. Yesterday I found <a href="http://www.glutenfreebeers.co.uk/">Green&#8217;s Beers</a> in stock at the local BevMo. They had three of their varieties: Quest Tripel Blonde, Discovery Amber, and Endeavour Dubbel Dark. At around $5.50 per 500ml bottle, this is not cheap stuff. But as a deprived enthusiast of the craft ale, this is worth the experiment.</p>
<p>Why this is huge: I used to design my after-hours business travel around looking up whatever highly-rated microbreweries and brewpubs might be in the neighborhood, sample the local taps, and write little reviews of each of &#8216;em. I loved tasting ales across the country - it was a simple and fun hobby, and gave me something to do while having to spend time away from home.</p>
<p>Then I started getting sick with celiac, and when the doctor told me I had to avoid wheat, barley, and rye for life, the only thing that went through my mind was &#8220;barley&#8230; barley&#8230; holy crap!! That means no beer!!!!&#8221;</p>
<p>Thankfully I seem to live in a time where gluten-free ale is an emerging market. </p>
<h3>Quest Tripel Blonde</h3>
<p>Monday: I miss IPA the most. Tripel Blonde sounded most like the description I was looking for, so trying this one first was irresistible. The beer pours clear but then seems to cloud up a bit, with lots of carbonation, and definitley has a light blonde color to it. The aroma was slightly floral, but not too sweet. Taste is great, with plenty of mouthfeel and a nice crisp taste. Definitely a good beer. I could drink this any day. I could use a bit more hops, but I said this about just about every beer I ever tried. OK this pint of beer is listed as being 8.5% ABV, so I might have an interesting time finishing up that ActionScript project I was working on this evening.</p>
<h3>Discovery Amber</h3>
<p>Tuesday: This beer pours in a nice rich amber color as advertised. There is a distinct hoppy aroma and the character is very ale-like. The beer really tastes damn good actually - lots of mouthfeel similar to the Quest, but I&#8217;d venture to say this one tastes even closer to some of the pale ales and amber ales I was used to in the past. If you had to give me my choice between this and the Quest, I&#8217;d probably pick this one. In fact, this is the first beer I&#8217;ve had since going gluten-free where I felt like there were <em>absolutely no compromises</em>. ABV is 6%.</p>
<p>At this point my recommendation to Green&#8217;s is: Open up a North American plant and start distributing these like mad. The Discovery Amber would stand up against any barley-based craft ale.</p>
<h3>Endeavor Dubbel Dark</h3>
<p>Let me just preface this section by saying that all of the American gluten-free brews I have tried thus far do not come even close to the three beers I have just tried from Green&#8217;s. Redbridge is my favorite of the American set, and it is not bad, but these three Green&#8217;s varieties are really outstanding. </p>
<p>Now, the dubbel dark was everything I&#8217;d expect from a dark beer. Had a similar flavor and character to many of the dark brews I&#8217;ve tried when I toured Germany and Austria way back when. Had a dark, malty, almost nutty flavor. Delicious. I transitioned away from dark beer in favor of pale ale over the decade before my celiac diagnosis, but this beer could easily get me back into it. This reminds me of why I liked dark beer in the first place. Note: This is nowhere near a stout, nor should the name &#8216;dark&#8217; imply stout. It is strictly in the double bock variety and a damn good specimen.</p>
<p>My advice to Green&#8217;s is: Having cheap access to Greens would be a reason for me to move to the UK. But I&#8217;m sure you guys don&#8217;t want that. I would tarniish the place and lower property values. Instead, open up manufacturing in North America, get the price down to something reasonable, and distribute these without reservation. This is the first beer label I&#8217;ve tried that really gets it right. Redbridge is great, and way cheaper, but Green&#8217;s has the quality part of the bargain hands down.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sanbeiji.com/archives/859/feed</wfw:commentRss>
		</item>
		<item>
		<title>Diff-ing commands on Mac</title>
		<link>http://www.sanbeiji.com/archives/858</link>
		<comments>http://www.sanbeiji.com/archives/858#comments</comments>
		<pubDate>Sat, 01 Mar 2008 04:30:36 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[BBEdit]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[compare]]></category>

		<category><![CDATA[diff]]></category>

		<category><![CDATA[Dreamweaver]]></category>

		<category><![CDATA[FileMerge]]></category>

		<category><![CDATA[merge]]></category>

		<category><![CDATA[opendiff]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[TextMate]]></category>

		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.sanbeiji.com/archives/858</guid>
		<description><![CDATA[There are several tools to compare files for changes out there for Mac OS X. I&#8217;ll cover a few here. The first and most basic is diff. From the command line, it looks like this:
diff -u old_file new_file
Where of course old_file is the old suspected filename, and new_file is the new one. This will give [...]]]></description>
			<content:encoded><![CDATA[<p>There are several tools to compare files for changes out there for Mac OS X. I&#8217;ll cover a few here. The first and most basic is diff. From the command line, it looks like this:</p>
<p><code>diff -u old_file new_file</code></p>
<p>Where of course old_file is the old suspected filename, and new_file is the new one. This will give you a quick glance at what is new. Each line of difference in the new file will be preceded by a plus (+) symbol, and each difference in the old one will be preceeded by a minus (-) Last saved timestamps will appear at the very top of the output.</p>
<p>A cool trick - if you use <a href="http://macromates.com/">TextMate</a>, you can pipe your diff output to it and take advantage of TextMate&#8217;s fancy-schmansy code coloring:</p>
<p><code>diff -u old_file new_file|mate</code></p>
<p><strong>Shift + Control + Option</strong> switches Textmate to the Diff bundle, and <strong>Shift + Control + Command + D</strong> will give you access to the context menu for all of the diff commands. Great for you Lightning Ruby Ninja™ coders out there who insist on never letting the tips of your fingers leave your keyboards.</p>
<p>If you have the <a href="http://developer.apple.com/tools/xcode/">XCode Developer Tools</a> installed, you get a second option installed: <a href="http://www.hmug.org/man/1/opendiff.php" title="manual for this command">opendiff</a>, laced with a <acronym title="Graphical User Interface">GUI</acronym> app called FileMerge:</p>
<p><code>opendiff old_file new_file</code></p>
<p>What is cool about this is that if you run opendiff from the command line, FileMerge takes over and shows you your differences with sexy Mac-ness, replete with an array of search and code merging commands at your disposal. That&#8217;s hot.</p>
<p>If you like <a href="http://www.barebones.com/products/bbedit/">BBEdit</a>, and who doesn&#8217;t, you have <a href="http://www.hmug.org/man/1/bbdiff.php" title="manual for this command">bbdiff</a> at your disposal too:</p>
<p><code>bbdiff old_file new_file</code></p>
<p>BBEdit has a file comparison and merging utility built in which does not suck at all.</p>
<p>Extra Coolness for Dreamweaver users: Select opendiff or bbdiff in your prefereces to compare files with their corresponding GUIs this way:</p>
<ul>
<li>Dreamweaver > Preferences > File Compare</li>
<li>Click Browse</li>
<li>Select bbdiff or opendiff from the file dialog, click OK, and <a href="http://www.adobe.com/devnet/dreamweaver/articles/compare_utilities.html">enjoy</a>.</li>
</ul>
<p>Lusty. So there&#8217;s a few options for finding out what your colleague did to break your perfect code. Happy diff-ing!</p>]]></content:encoded>
			<wfw:commentRss>http://www.sanbeiji.com/archives/858/feed</wfw:commentRss>
		</item>
		<item>
		<title>Last.fm</title>
		<link>http://www.sanbeiji.com/archives/857</link>
		<comments>http://www.sanbeiji.com/archives/857#comments</comments>
		<pubDate>Sun, 24 Feb 2008 06:16:33 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
		
		<category><![CDATA[Music]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[Double Bass]]></category>

		<category><![CDATA[last.fm]]></category>

		<category><![CDATA[social networks]]></category>

		<guid isPermaLink="false">http://www.sanbeiji.com/archives/857</guid>
		<description><![CDATA[I am a recent convert to Last.fm, but know that this has been a long time coming.
I have hit Last.fm many times since they launched. But I always found it, well, kind of useless in the past. I wasn&#8217;t grabbing very useful recommendations, and the usability of the software client and the website were lacking [...]]]></description>
			<content:encoded><![CDATA[<p>I am a recent convert to <a href="http://www.last.fm">Last.fm</a>, but know that this has been a long time coming.</p>
<p>I have hit Last.fm many times since they launched. But I always found it, well, kind of useless in the past. I wasn&#8217;t grabbing very useful recommendations, and the usability of the software client and the website were lacking in my opinion. Cut to <em>many</em> months later, and something appears to have changed. The content of this site appears to have improved since last I checked - more music of the type I was looking for. Probably the root cause of my problems before was that I have a masters in music performance on a bizarre instrument known as the double bass, with tastes that includes baroque lute music, north Indian classical music, Charles Mingus, and Nine Inch Nails. Suddenly where before things appeared kind of barren in the eclectic world, some critical mass has been reached to the point where I am finding music I am interested in, and the mind of this thing is able to make reasonable recommendations to feed my insatiable consumption of new things to hear. This is the good part.</p>
<p>However, there is a bad part. Their widgets are a hideous bluk of code. I so wish they would just make &#8216;em 100% Flash or something so I could do some sort of standards-compliant embed mode that had a bit more architectural beauty than this behemoth:</p>
<p>(Note - the widget that was here has been redacted because I couldn&#8217;t stand looking at the <acronym title="HyperText Markup Language">HTML</acronym> validation errors that appeared here every single time I visited my own website. Please visit <a href="http://www.last.fm/listen/user/sanbeiji/playlist">my playlist on last.fm</a> instead.)</p>
<p>It pained me to post that. Sure it looks and works great in a nice big browser, but I&#8217;m sure this is going to suck on my iPhone and embedding all that inline design cruft and <acronym title="HyperText Markup Language">HTML</acronym> table junk was heartburn-inducing. 100% Flash would have been nice. Or better, just an <acronym title="MPEG Layer 3 - a common audio codec for music files">MP3</acronym> stream <acronym title="Uniform Resource Locator">URL</acronym>. Well, it is a cool widget and all, but it just seemed like a lot of code&#8230;</p>
<p>In addition, the site itself seems to be a bit much. I think less features would make it more usable, but it&#8217;s hard to take things back once they&#8217;re out there. There should be an add to playlist button or something in the player when viewing a single track web page rather than leaving it in the left column. Recommending tracks to others in my network should be easier - a select menu or type-ahead autocomplete feature rather than having to go look up or memorize everyone&#8217;s user IDs.</p>
<p>But on the whole, this is the most interesting music-related website I&#8217;ve seen yet. I&#8217;ve been addicted to it for the past few days now and really think this one is a hit.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sanbeiji.com/archives/857/feed</wfw:commentRss>
		</item>
		<item>
		<title>Who Can Win?</title>
		<link>http://www.sanbeiji.com/archives/856</link>
		<comments>http://www.sanbeiji.com/archives/856#comments</comments>
		<pubDate>Tue, 19 Feb 2008 03:08:40 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
		
		<category><![CDATA[Politics]]></category>

		<category><![CDATA[Obama politics Clinton America]]></category>

		<guid isPermaLink="false">http://www.sanbeiji.com/archives/856</guid>
		<description><![CDATA[A compelling presentation from Lawrence Lessig on who can win against McCain, and who is the best candidate:
http://www.youtube.com/watch?v=Wq7VCQO5siU]]></description>
			<content:encoded><![CDATA[<p>A compelling presentation from <a href="http://lessig.org/">Lawrence Lessig</a> on who can win against McCain, and who is the best candidate:</p>
<p><a href="http://www.youtube.com/watch?v=Wq7VCQO5siU">http://www.youtube.com/watch?v=Wq7VCQO5siU</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sanbeiji.com/archives/856/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
