Monday, 17 September 2007

Oracle to_date function dates from 20th century

there is a very useful function in Oracle DB to_date. But when you run:
select to_date('78/06/01','YY/MM/DD') from dual;

you might be expecting a date '1-Jun-1978' (might differ depending on your local nls settings), but you get surprisingly: '1-Jun-2078'.
Helpful is parameter RR instead of YY.
RR returns years from 21st century when given value is in range 0-49
and returns years from 20th century when given value is in range 50-99

For most cases you probably want:
select to_date('78/06/01','RR/MM/DD') from dual;


Saturday, 1 September 2007

Mencoder converting files

Ever wanted to play a file that your favourite mplayer does not want to play?
Or it shows other difficulties?

Recently I got some tech movies in .flv (flash) format.
Mplayer1.0.1rc1 plays them, but you cannot seek in those files.
Problematic could be as well .mov files.
For the .flv files you can checkout the latest version of mplayer from the subversion.
You can though convert to a format that mplayer accepts without problems (like .avi)

mencoder input.flv -oac pcm -ovc lavc -o output.avi
mencoder -oac pcm -ovc lavc -o output.avi

Happy watching....