All Japanese All the Time

Posted in japanese on October 14th, 2008 by admin

Recently I came across great blog that can make a breakthrough in your mind if you really, I mean REALLY want to master Japanese. Please check it, you won’t regret.

http://www.alljapaneseallthetime.com

BTW this site gave me an answer why I couldn’t really find Japanese movies or anime with Japanese subs regardless how hard I tried:

… the thinking in Japan’s movie industry has typically followed two distinct lines:

  1. Hearing-impaired people can go in the general direction of heck.
  2. Subtitles on foreign movies are not merely intended to repeat dialogue, but to convey, clarify and expound on dialogue — in other words, to pick up perceived slack in the audio translation

There are several hot discussions going on around his method, many people admire his way of learning the language, others are quite skeptical. But IMHO you should read it yourself, analyze it and then…

Do whatever works for you.

Tags: ,

Logo: “dragon book” allusion

Posted in kanjibox on October 14th, 2008 by admin

Some of you might know an amazing book by Alfred Aho & Ravi Sethi ‘Compilers: Principles, Techniques, and Tools‘ which is often referred as “dragon book“. I would say that many people treat kanji the same way. Therefore we’ll get pretty dragon as a logo for the site.

Toon Dragon - Modo Render (Draft).jpg

Tags: ,

Zend & Smarty – ステップニ

Posted in development on October 13th, 2008 by admin

In this post I will reveal the secret of really smart integration between Zend and Smarty :) Since I’m too lazy to write 10 similar functions inside the Smarty plugin, I decided to modify the Smarty compiler. And it worked well.

Making Smarty zend-aware

This step is simple – you’re just adding a function that allows you to call Zend View Helper using
call_user_func_array.


class KB_SmartyZendAware extends Smarty {
    private $_zendView                 = null;
    private $_cfg;

    public function __construct() {
        parent::__construct();
        $this->compiler_class = 'KB_SmartyZendAwareCompiler';
    }

    public function setZendView(Zend_View_Abstract $view) {
        if( $view === null ) {
            throw new KB_Exception('Zend_View cannot be null.', KB_Exception::KB_SMARTY);
        }
        $this->_zendView = $view;
    }

    public function callZendViewHelper( $name, $method, $args ) {
        if( $this->_zendView === null || ! is_string($name) || strlen($name) == 0 ) {
            return '';
        }
        $helper = $this->_zendView->getHelper($name);

        if( ! is_string($method) || strlen($method) == 0 ) {
            return call_user_func_array( array( $helper, $name ), $args);
        } else {
            return call_user_func_array( array( call_user_func( array($helper, $name) ), $method ), $args);
        }
    }
}

Read more »

Tags: , ,

Zend & Smarty – ステップワン

Posted in development on October 9th, 2008 by admin

It’s been a while since I updated the blog. But the things were pretty busy lately…
So finally the application’s skeleton is in place. It uses Zend + Smarty. I’m also done with
Tanaka corpus parsing. I can only say that APR is really easy to use.

Here I won’t explain in details how to integrate Zend View and Smarty. This is actually
pretty easy. You may refer a pretty old post of Ralf Eggert ‘Integrating Smarty with the Zend Framework‘ or read Quentin Zervaas’s ‘Practical Web 2.0 Applications with PHP‘.

After you nailed this most likely you’ll start thinking about something more elaborate, capable of supporting Zend_View helpers such as headScript, doctype etc. And most probably you will end up with a plugin class that maps Zend_View helpers to Smarty custom functions.

Mine code looked like this:

Read more »

Tags: , ,