Tuesday, July 24, 2012

Zend Framework: How to include directories with dash or hyphen

So before I can forgot it in Zend, I will post this as a notes and reference.
When you want to include a directory with dash or hyphen (-) symbol, like for example, a helper. You can do it by using the code below.

    protected function _initActionHelpers()
            APPLICATION_PATH . '/../library/dash-classes/Action/Helper/',

Where you have your helper stored in ../library/dash-classes/Action/Helper/Example.php

Where your Example.php might look something as,

class DashClasses_Action_Helper_Example extends Zend_Controller_Action_Helper_Abstract
    function direct()
        $session = new Zend_Session_Namespace('exampleSession');
        return $session;

Converting mp4 to AVI using ffmpeg

I got this commands until it works on mine. Currently, I am running on Mac OS X Lion so, in particular, I would say this works in my part using Mac OS X Lion.

$> ffmpeg -i batman.begins.mp4 -vcodec libxvid -ab 192k -sameq -acodec libmp3lame -ar 48000 -ac 2 batman-begins.avi

Specifically, my choices are are need to be converted to AVI so I can put it into my USB and play via our HD TV which seemed to consistently support using this encoding or conversion.

-vcodec which I use libxvid codec for my video encoding
-ab        192k which, I believe, using stereo would need this bit rate.
-sameq   So I got the same quantization values
-acodec  so I use libmp3lame
-ar          is set to 48000 audio sampling frequency
-ac          is set to 2 to have a dual stereo type of audio

Hope this helps.

Monday, July 23, 2012

Richest man in the valley

You know, I got this story from my e-mail a very very long time ago and still, this is the most shortest and simplest story that I like most in my entire life.

Anyway, here it goes. [courtesy of MountainWings.com]

Enjoy reading!!!

The Richest Man In The Valley

A rich landowner named Carl often rode around his vast estate so
he could congratulate himself on his great wealth.  One day
while riding around his estate on his favorite horse, he saw
Hans, an old tenant farmer.  Hans was sitting under a tree when
Carl rode by.  Hans said, "I was just thanking God for my food."

Carl protested, "If that is all I had to eat, I wouldn't feel
like giving thanks."

Hans replied, "God has given me everything I need, and I am
thankful for it."

The old farmer added, "It is strange you should come by today
because I had a dream last night.  In my dream a voice told me,
'The richest man in the valley will die tonight.'  I don't know
what it means, but I thought I ought to tell you."

Carl snorted, "Dreams are nonsense," and galloped away, but he
could not forget Hans' words: "The richest man in the valley
will die tonight."  He was obviously the richest man in the
valley, so he invited his doctor to his house that evening.
Carl told the doctor what Hans had said.  After a thorough
examination, the doctor told the wealthy landowner,

"Carl, you are as strong and healthy as a horse.  There is no
way you are going to die tonight."

Nevertheless, for assurance, the doctor stayed with Carl, and
they played cards through the night.  The doctor left the next
morning and Carl apologized for becoming so upset over the old
man's dream.  At about nine o'clock, a messenger arrived at
Carl's door.

"What is it?" Carl demanded.  The messenger explained,

"It's about old Hans.  He died last night in his sleep."

Hope you just like what I have shared.