Crunchytoast.com

What’s better than toast? Crunchytoast!

crunchyt sez:

This is my first website ... after 15 years of making them for everyone else! Hope you enjoy it too.

Archive for the 'ruby on rails' Category

Improved Romaji Convertor in Ruby

Thursday, April 1st, 2010

Last year I re-posted some obsure Kana & Romaji converter code for Ruby. Although I had fixed it to work with modern versions of Ruby, the romanization converter just didn’t want to work! Finally after dedicating an afternoon to it, I found that the regex used to split the source string was returning nil. At [...]

Read the rest of this entry »

The Application Controller in Rails 2.3 has been renamed to application_controller.rb, whereas previously it was application.rb. If you don’t fix it, calling any controller will return this cryptic error.
NameError in MyController#search
uninitialized constant ApplicationController
After trying to fix this by checking out an older revision, reconfiguring Mongrel/Apache and generally turning things on & off, I discovered [...]

Read the rest of this entry »

Hopefully the title of this post got your attention! One of my (very few) readers asked about the Japanese text transformations I use to enhance Japanese and English mixed text queries.
I promised to post some of the snippets, so here they are.

Read the rest of this entry »

Japanese Sphinx Explained

Friday, May 1st, 2009

I recently received some comments regarding the Sphinx Search Japanese character table. This prompted me to document it a little better. To be honest, I originally put the character table together during a late night coding binge in 2008. As such my memory was a little fuzzy.
After visiting the Oracle of Unicode (now resident at [...]

Read the rest of this entry »

Sphinx Search in Japanese

Tuesday, April 14th, 2009

About 4 months ago I was wondering how hard it would be to get Sphinx to work in Japanese. This fantastic freetext search engine by Andrew Aksyonoff has literally changed my approach to web development.
At the time there were instructions for Chinese, but no Japanese unicode character map. Basically, Sphinx needs a “guide” to read [...]

Read the rest of this entry »

Building Sphinx 0.9.9-rc1 on Open Solaris

Saturday, February 28th, 2009

Well if 0.9.8.1 was tough, this troubled me so much I considered switching to Xapian. Don’t get me wrong, Xapian is a great looking search engine! But after playing with Sphinx for many months, I didn’t want to start from scratch!
The problem started with multi-value attributes (MVA). Basically they don’t work on SUN Solaris in [...]

Read the rest of this entry »

Building Sphinx 0.9.8.1 on Open Solaris

Thursday, February 26th, 2009

Okay, so the Sphinx Freetext Search Engine is a game changer. Easy easy to index, easy to integrate into PHP / Rails / Django, unbelievably fast (esp. compared to database freetext engines) and easy to install.
Okay, so the easy to install thing doesn’t apply to Solaris! The main issue is linking differences because Solaris library [...]

Read the rest of this entry »

Return to acts_as_taggable_on

Sunday, February 15th, 2009

The Rails tag plugin acts_as_taggable_on is a handy drop-in feature set for adding tags to your RoR applications.  The documentation is slightly more than minimal, and upon peeking under the hood, you find almost no comments.
I am in the process of adding a caching table that will be updated asynchronous to the user request life-cycle. [...]

Read the rest of this entry »

Stopping & Starting a Mongrel Cluster

Friday, November 28th, 2008

Pretty easy stuff eh? If only I didn’t have an urge to share my working notes with the world.
Cluster Commands

mongrel_rails cluster::stop
mongrel_rails cluster::start
mongrel_rails cluster::restart
Stand Alone Commands
mongrel_rails restart
mongrel_rails stop

Read the rest of this entry »