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.


Everyone is talking about the iPad. I reckon all we’re going to hear for a while will be “iPad iPad iPad!”

Having read countless comments about the new iPad having “no SD card slot” and it being made only for fanbois, I found myself considering the question:

Is the iPad better than a Netbook?

Many early commenters expressed hopes for a Mac Netbook instead of an over-sized iPod Touch (with no camera and limited storage). So the first thing I did was look for some articles on Netbook Hackintoshes.

Read the rest of this entry »

Everyone is talking about the iPad. I reckon all we’re going to hear for a while will be “iPad iPad iPad!”

Having read countless comments about the new iPad having “no SD card slot” and it being made only for fanbois, I found myself considering the question:

Is the iPad better than a Netbook?

Many early commenters expressed hopes for a Mac Netbook instead of an over-sized iPod Touch (with no camera and limited storage). So the first thing I did was look for some articles on Netbook Hackintoshes.

Read the rest of this entry »

You remind me of someone! If you’re reading this, then like me you must forget regex expressions frequently. Despite the chunky snippets found within the Net’s regex libraries, I can never find the Japanese related ones I want. Of course if you search for 規制表現 you are more likely to find them! Surprise, surprise, Japanese speaking coders write about them more than English speakers :(

So here is a small compilation of essential kisei-hyogen (regexes in Japanese) that you will need if you do any Japanese text or data processing.

These should all be PERL compatible, and assume UTF8 encoding. If you are using a different encoding and get errors, try converting using ICONV or a platform specific function.

Without further ado, let the download begin:

Read the rest of this entry »

This is only a quickie, but important enough to spread the word (oh, btw IE blows!)

In all versions of Internet Explroer (IE 5,6,7,8 apparently), the browser silently creates an immutable global variable for every element ID. This can lead to naming clashes when using jquery.

For example, I had the following code:
startDate = $('#startDate');

Here the DOM element ID is startDate. However, whenever I tried to access the jQuery functions such as startDate.attr() or startDate.val(), i received this terse Internet Explorer error:

“Object doesn’t support this property or method”

Simply by renaming your local variable to something else, such as myStartDate, you can avoid this problem! Peace at last.

Kudos shout out to Rick Strahl whose March 2009 post is the only resource I found confirming this!

Aside from the obvious indications of geekiness (a blog about programming & human language), Google has found me geek-worthy enough to join the Google Wave preview! Read the rest of this entry »

Hilbert’s Pallette, by Anton Sherwood
Awesome colorful boxes!

If you’ve been using the Colorbox Plugin for jQuery, you may have noticed that it rocks! Compared to the bevvy of other JavaScript modal dialogs, this one animates smoothly, loads quickly, is lightweight and well suited to jQuery projects.

However, the standard way to call it is from a click event. In fact, I couldn’t find any resources documenting how to launch a Colorbox programatically. The examples from the Colorbox website were strictly “on click” oriented. After digging through the source code, I tried a few things and hey presto, the answer was simpler than expected. For calling Colorbox from a function (i.e. without an click directly preceding it), you should do this…

[javascript]//Launching jQuery Colorbox without a click
$.fn.colorbox({href:’/href.html’, open: true, iframe: true, width:300, height:400});
[/javascript]

This will open the colorbox immediately upon execution, this example opens in an iframe with width/height as shown. Note, the only options required to make it work are href and open:true. See the documentation for all other options.

For those of you wanting to write your own plugin, the Colorbox internals are a study in good jQuery plugin design. It features some nice techniques, including code optimizations that increase compression, and aliasing of otherwise long function names.

The Business Japanese Test held in 2009 recently delivered their results to my door. Without any further ado, I am happy to announce I got a high J2 (well above the test average). I was a little disappointed about not being in the lofty J1 or J1+ leagues, despite having JLPT 1 bragging rights! However I was close enough to J1 to make me want to try again.

Result Spread

Here is an overview of the BJT ranks and the number of people who attained each rank, out of the 2,788 people who sat the test in 2009.

Rank # People
J1+ (600-800) 198
J1 (530-599) 509
J2 (420-529) 1,402
J3 (320-420) 515
J4 (200-419) 134
J5 (0-199) 10
TOTAL 2,788

Read the rest of this entry »

Back in Black

August 25th, 2009

Because of the locals’ penchant for wearing dark colors in winter, they call Melbourne the Black City.

The weather occasioning this first post since my return home is more than appropriate. Today, Police recommended people in Melbourne’s central business district leave work early to avoid “torrential rain” and “destructive winds”. Yikes!!!

Looking over my posts this year, I am mostly happy with the coverage of my various obsessions; mostly. I still owe you a few iPhone Tutorials. These were promised in July 09, but moving countries got in the way. Apologies to you iPhone fans.

With regular, ADSL2 speeds connecting me to the Internet, I feel I can be productive again. Only time will tell, but check back soon, it should be fun.

Today I sat through 120 minutes of furious scribbling, deducing and cursing my momentary lapses in concentration. To most people this strange exercise is known as the Business Japanese Proficiency Test (BJT). I prefer to think of it as the BIG Japanese Test.

As you may have guessed from my other posts, Japanese and Coding are two of my three favourite pastimes. Having successfully stumbled through the Japanese Language Proficiency Test, Level 1 in 1999, I figured some 10 years later I would attempt the BJT.

As is par for the course, I am narrow-casting my impressions out to you.

BJT Test Format

The test is comprised of 3 main sections:

i) Listening (50 mins, 35 questions)
ii) Listening & Reading (30 mins, 30 questions)
iii) Reading (40 mins, 35 questions)

Each section contains a range of questions from somewhat easy to very hard. All are designed to detect if you really have lived in Japan too long.

During practice, the Listening Section was not impossible, given time to think and a second hearing. Under test conditions however you get about 1 minute per question and only hear it once! Even easy questions can be flubbed by paying too much attention to the rising damp in the test room (gotta love Japanese universities!) 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 the fix.

rake rails:update

That was all it needed! The Rake task will rename the file accordingly, and instructs you to update your source code repository. I guess it serves me right for not using the same Rails version on my development and production servers. On development I use 2.2.2 and on production I upgraded to 2.3. A point release can be a big difference!

Hope this saves you some desperately late nights.