Blog

  • Ashitaka and San

    Yet another song from Japanese anime

  • To Zanarkand

    To Zanarkand

    Finally, I manage to finish this piece.

  • Sadness and sorrow

    Sadness and sorrow

    I’m not a fan of Naruto, this song is so beautiful and sad. Mainly sad, but beautiful. A little bit hesitance while playing this piece because of the feeling it brought to me…

    P/S: sorry for the short

    Music sheet from Piano Squall

  • Minuet in F major

    Minuet in F major

    The fastest piece (so far) I can manage to finish.

  • Allegro in B-flat major

    Allegro in B-flat major

    Not very good, but decent for a novice like me.

  • To love’s end

    Once again, the Japanese hits me again. Such a beautiful and harmonic melody!

  • Learning sign language

    Learning sign language

    Yesterday, I was learning sign language with my son. He turned out to have a very good memory. He remembered many gestures – 21 out of 26 characters – after few times practicing. And now he is exciting and play the gestures again and again.

    I realise that learning something new with my son is fun and effective. And now, I’m waiting for him to grow old enough to learn piano with me. Next year, when he is 4 year olds, I will start teaching him some basic of this instrument. If he finds himself interested in playing music, I will find a teacher to help him to develop this skill.

  • The very first abroad journey of my son

    The very first abroad journey of my son

    This week, I took my son to his debut oversea trip. I have chosen Singapore due to their clean and convenient public mass transit. Besides, they offer many attractions that suitable for children, eg: ArtScience Museum, a big Zoo, and a huge fish tank (S.E.A Aquarium).

    The trip turns out was quite good, more than I expected. My son enjoyed the tour so much, he walked a lot by himself everyday (8-9km each day) until getting tired and asked for my help. I had no idea that he could walked that far. In fact, I was worry about carrying him for half of day for more. It seemed I had looked down on my son. Well done, buddy!

    Now, I’m choosing a new destination, Korea or Taiwan (may be).

  • Laminas delegator service

    Laminas delegator service

    Delegator service is a wrapper service which houses the “real” service. This is useful when you want to “decorate” your service, do some extra stuff without changing the working one. Laminas supports multi delegator services for each service, and it follows the nested object structure.

    This sample is base from this.

    Code

    The delegator service class, this will handle the stuff you want.

    namespace MyApp;
    
    class MyServiceDelegator extends \MyApp\MyService {
        protect $myservice;
    
        public function __construct(MyService $service) {
            $this->myservice = $service;
        }
    
        public function hello($name, $title = null) {
             if ($title == null) {
                 $title = 'Ms. ';
             }
             
             $result = $this->myservice->hello($title . $name);
    
             return $result;
        }
    }

    The delegator factory class

    namespace MyApp;
    
    class MyServiceDelegatorFactory implements Laminas\ServiceManager\Factory\DelegatorFactoryInterface\DelegatorFactoryInterface  {
         public function __invoke(\Interop\Container\ContainerInterface $container, $name, callable $callback, array $options = null) {
             return new \MyApp\MyServiceDelegator($callback());
         }
     }

    Configuration

    'service_manager' => [
        ///Other service configuration
        ///...
        'delegators' => [
            \MyApp\MyService::class => [
                \MyApp\MyServiceDelegator::class
            ]
        ]
    ]

    Usage

    $application->getServiceManager()->get(\MyApp\MyService::class);///this returns \MyApp\MyServiceDelegator instead of \MyApp\MyService

    Happy coding!

  • Toss a coin to your witcher

    Toss a coin to your witcher

    “People linked by destiny will always find each other.”

    A nice series, awesome fighting scenes, story line was good (of course, it based on a good fiction)

    https://youtu.be/hqbS7O9qIXE
    this song had stucked in my head for months