Saturday, November 27, 2010

k-lite cannot play rm rmvb file RealAudio COOK

When I install K-Lite Mega Codec Pack 6.5.0 on WinXP SP3, Windows Media Player and Media Player Classic can play rmvb/rm files smoothly.

After I install Real Player ver 14 Hexlix Powered, WMP and MPC failed to render rmvb/rm files. It shows the following errors:

C:\Downloads\Movie\movie.rmvb::Output 00 (Audio Stream)

Media Type 0:
--------------------------
Audio: RealAudio COOK 44100Hz stereo

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: Unknown GUID Name {4B4F4F43-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 1
lSampleSize: 14880
cbFormat: 112

WAVEFORMATEX:
wFormatTag: 0x2004
nChannels: 2
nSamplesPerSec: 44100
nAvgBytesPerSec: 0
nBlockAlign: 930
wBitsPerSample: 16
cbSize: 0 (extra bytes)

pbFormat:
0000: 04 20 02 00 44 ac 00 00 00 00 00 00 a2 03 10 00 . ..D¬......¢...
0010: 00 00|2e 72 61 fd 00 05 00 00 2e 72 61 35 00 00 ...raý.....ra5..
0020: 00 10 00 05 00 00 00 4e 00 18 00 00 03 a2 00 00 .......N.....¢..
0030: 00 00 00 07 55 67 00 00 00 00 00 10 03 a2 00 ba ....Ug.......¢.º
0040: 00 00 00 00 ac 44 00 00 ac 44 00 00 00 10 00 02 ....¬D..¬D......
0050: 67 65 6e 72 63 6f 6f 6b 01 07 00 00 00 00 00 10 genrcook........
0060: 01 00 00 03 08 00 00 25 00 00 00 00 00 06 00 05 .......%........

I un-install all. No matter how I change the installation steps, i.e. install RealPlay first then K-Lite, or install K-Lite first then RealPlayer, or install older version of K-Lite, or Real Alternative, the result is the same. Once RealPlayer is installed, K-Lite is broken.

Official FAQ says:
http://www.codecguide.com/faq_mpc.htm#item23
Q: RealMedia files (.rm .rmvb) freeze or play without sound

A: MPC is not fully compatible with RealPlayer 11 and 12.

or C:/Program Files/K-Lite Codec Pack/Info/faq_playback_issues.htm#item32
Q: RMVB files play without sound

A: You are probably missing a decoder for RealAudio COOK. You can install that by following these steps:

Download the Windows version of binary codec pack for MPlayer.
http://www.mplayerhq.hu/design7/dload.html#binary_codec
Extract these files from the .zip archive: cook.dll, pncrt.dll, sipr3260.dll, drv33260.dll, drv43260.dll
Put those files in this folder: C:\Windows

It seems redundant as K-Lite itself is the bundle of media libraries, why do we need to download additional binary from 3rd party? And the above steps are troublesome.

The easier way and solution is that:

1) Install K-Lite Mega Codec Pack (contains Real Alternative) or Real Alternative first. You'll see the following directory:
C:\Program Files\K-Lite Codec Pack\Real\Codecs

2) Save a copy of this [Codecs] directory. Because it'll somehow disappear when RealPlayer is installed, or you install K-Lite after RealPlayer, this folder won't exist (I don't remember clearly).

3) Then, install RealPlayer. As expected, WMP and MPC cannot play rmvb/rm properly (without sound, missing RealAudio COOK)

4) Go Control Panel -> System -> Advanced tab -> [Environment Variables] -> edit Path

Add the following path:
%path%;C:\Program Files\K-Lite Codec Pack\Real\Codecs

Adding the above path, [Codecs] folder is visiable to Windows. Now you try to play rmvb/rm with WMP and MPC, it will play smoothly again.

Monday, October 25, 2010

Search in Open Source

Sometimes I find it is quite helpless/having good life/cheating being a software engineer myself. In the daily work, I rely so much on 3rd party library. A lot of implementations are already widely available in Internet. I don't really have to do anything from scratch.

However if I am required to do from scratch? In fact I don't know how. The theory and spec can be very thick... the basic implementation can be very complicated... the simple thing itself can be a PhD project.

... ...

Anyway, the summary is, not only to search the keyword in Google. There are great developers in Japan (http://sourceforge.jp/) and China. And maybe other non-English speaking countries too, such as Russia, just that I don't know.

Monday, September 13, 2010

IIS on Windows 7 / Vista / XP Pro

A project may propose using Webservices. So here I find how easy it is to enable IIS on Windows.

For Windows 7 / Vista, it is a build-in feature:
http://learn.iis.net/page.aspx/28/installing-iis-7-on-windows-vista-and-windows-7/
http://www.howtogeek.com/howto/windows-vista/how-to-install-iis-on-windows-vista/

For Windows XP Pro, it can be installed free:
http://www.webwiz.co.uk/kb/asp_tutorials/installing_iis_winXP_pro.asp

Monday, August 30, 2010

How to install GCJ: GNU Compiler for Java?

In Windows world, there is no single GCJ installation.exe that installs GCJ.

GCJ exists inside Cygwin. So we have to install Cygwin. Detailed Step here:
http://www.mcclean-cooper.com/valentino/cygwin_install/

Cygwin contains many components. It is not a good idea to install all and fill up the harddisk. How to decide which one to install?

My feeling is, choose only those components needed.

For example, I am clear that I want to use gcj ( GNU Compiler for Java ). So in the Cygwin-setup Search box, I type in “java” keyword. I choose only Devel/gcc-java.

The good thing is, when I click Next button, all the dependencies will be automatically chosen. Hence only the minimum set of components will be downloaded and installed.

When I am using gcj, along the way I’ll hit additional error, e.g. “cannot find…” missing libraries.

Error Message:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -liconv
collect2: ld returned 1 exit status

Then, I’ll launch Cygwin-setup again to install the missing library.

Keyword to install:
libiconv

Tuesday, July 13, 2010

Detect Brower Javascript Version

The following Javascript will show which version of Javacript the browser supports.
http://javascript.about.com/library/bljver.htm

Surprisingly, IE8 on Windows 7 only supports up to version 1.3. No wonder some Javascripts which work on Firefox (up to 1.8), Safari and Chrome (up to 1.7) do not work on IE8.










Friday, June 25, 2010

GIMP transparent background

It is quite easy to do transparent background with GIMP.

Clear demo is here:
http://www.fabiovisentin.com/tutorial/GIMP_transparent_image/gimp_how_to_make_transparent_image.asp

Note: Save as GIF (transparent background capable)

Thursday, April 15, 2010

Windows 7 and Java JDK 1.6 Timezone issue

Same piece of Java program running on Windows 7 and JDK 1.6, the date time related routine returns TIME ZONE :Greenwich Mean Time, which is wrong.

Insteads of going into source code level to add in timezome "GMT+8" routine, we can alter the timezone properties at command line level.

java -Duser.timezone="GMT+8" .....
or
java -Duser.timezone="Asia/Singapore" .....


Reference:
http://bugs.sun.com/view_bug.do?bug_id=6456628

Wednesday, March 17, 2010

Free Audio Sound Card Recorder

This software, is able to record input sound into computer with various formats.

http://www.freeaudiorecorder.net/Files/FreeAudioRecorderSetup.exe

Using tips:
1. To reduce noise, set the recording volume to 10.

Sunday, March 14, 2010

Powepoint PPT to Video VCD / JPG JPEG convert conversion

If we really have to go somewhere with TV but without projector and computer, to give the presentation, how to do?

1) Convert PPT to Video DVD

There are a few Powepoint PPT to Video DVD convert conversion software. However, it seems all of them need to pay.

http://www.mydigitallife.info/2007/10/09/how-to-convert-powerpoint-presentation-ppt-to-video-avimpeg-flash-and-cddvd/

I am using this one:
http://www.ppt-to-video-converter.com/downloads/smart-ppt-converter-setup.exe

Note: To maintain the quality, only DVD is accepted.

2) Convert PPT to picture JPEG

Most of the DVD players today can show JPEG file. So covert PPT to picture JPEG file will do also.

Note: name of JPEG file as
01.jpg
02.jpg
03.jpg
...
10.jpg

So that the sequence of the pictures will remain in order.

Thursday, January 21, 2010

Friday, December 18, 2009

Linux Shortcuts and Commands

http://linux.about.com/od/linux101/l/blnewbie5_1.htm
http://www.unixguide.net/linux/linuxshortcuts.shtml

Tuesday, September 01, 2009

GIMP Animated GIF

It is not quite straight-forward to do animated gif.

The following is the solution with GIMP.
http://www.csb.yale.edu/userguides/image/moviemaker/anim_gif.html

Monday, August 24, 2009

职场“冷暴力”

http://www.ftchinese.com/story.php?storyid=001028296

智联招聘网站近日公布一项逾万名职场人参与的调查结果:七成以上的职场人曾遭受过职场“冷暴力”。

在这个崇尚和谐的年代,玩勇斗狠的暴力路线不再时髦,但平静海面下“潜伏”的冷暴力现象,却像泰坦尼克号遇到的冰山一角,远远一瞥,足以令人不寒而栗。初入职场的新鲜人可能会瞪大眼睛抛出疑问——什么是职场冷暴力?

所谓职场“冷暴力”,通常是指上司或同事用非暴力的方式刺激对方,导致对方情绪受挫心灵受伤的行为。打个比方,从前被皇帝抛在脑后长期不理不睬的妃子,遭遇的便是职场冷暴力,如果该妃子甚至被派去打扫庭院端茶倒水,那就是相当严重的职场冷暴力。

我有位八零后闺蜜,自从怀孕之后骤然察觉职场冷暖,在她妊娠反应最严重的怀孕初期,她的老板不仅拒绝了她在家办公的申请,而且大张旗鼓地招聘新人接替她的工作。刚招到人没两天,便要求她抓紧完成工作交接,提前回家“享受”产假外的无薪长假——“不用着急,生孩子是大事,哺乳期结束再回来上班也来得及!”大肚子的闺蜜二话不说收拾东西乐颠颠回家,回过味儿来又忍不住碎碎念——他们这是为我好呢?还是想赶我走呢?

我说,都这么赤裸裸的职场冷暴力了,明摆着想把你扫地出门节约成本,你还看不穿!跟善于算牌的职场前辈相比,有些八零后职场人确实显得天真了那么一点点,别人都快要胡了,自己还傻傻在旁边准备点炮。

正是这类“很傻很天真”的年轻人,往往更容易遭遇所谓的“职场冷暴力”。调查显示,职场人遭受的“冷暴力”中,被打入冷宫“不受领导重用”以44.5%的比例排在第一位,其次是“拼命工作而升职、加薪总是轮不到自己”,比例为41.2%,排在第三位的是“领导时常给自己小鞋穿”,如安排根本不可能完成的任务,比例为29.2%。

刚入职的新人,常会抱怨主管给自己分配的工作技术含量低,公司里的前辈不把自己放在眼里,汇报工作时上司态度不冷不热不置可否,并将之简单归结为“职场冷暴力”,典型言论如下:“哎,成天干活那么辛苦没人体谅,白眼倒是没少捱,真不想在这种充满冷暴力的环境中继续呆下去了!”

其实仔细想想,以上种种算是真正的“职场冷暴力”吗?很多时候,让你做小事是为了奠定做大事的基础,不把你放在眼里是因为你什么都不会,汇报工作收效不佳是因为你没领会领导意图,而不是什么人成心跟你过不去。在这种情况下,与其抱怨遭遇“职场冷暴力”,不如以开放性的状态加强人际沟通和学习,努力提高自身能力和素养,尽快赢得别人的尊重和认可。

真正可怕的职场冷暴力,往往是针对强者的。因为你强,才会招致同事嫉妒,因此遭遇不动声色的联合抵制。在这种情况下,要想跳出受人摆布的境地,只有两件事可做:一是让自己变得更强,强到别人的冷暴力无法阻挡你前进的步伐。二是学会站队的艺术,选择和能够帮助自己的同事和上司站在一起,找到适合自己的位置才能立于不败之地。

所以,当传说中的职场冷暴力发生在你身上时,如果你是弱者,不要抱怨,你所要做的就是努力提高自己的战斗力;如果你是强者,不要惧怕冷暴力的袭击,因为这是你锻炼人际艺术的最佳实战机会,也是通往成功之路的必要考验。

Renew Singapore PR + Apply China Visa 中國簽證

With SingPass and Credit Card,
Singapore PR can renew Re-Entry Permit and update new passport number via the following website:

http://www.ica.gov.sg/page.aspx?pageid=152&secid=150
https://erep.ica.gov.sg/erep/index.do

Fill in everything online. So convenient!!!!

Validity date starts on the renewal day. So renew it on the later day.


Renew Malaysia Passport

Revelent website: http://www.imi.gov.my/index.php?option=com_content&view=article&id=47%3Apma&catid=34%3Apasport&Itemid=34&lang=en

Items to bring:
* Print out the form, 2 sided in 1 paper.
* 2 blue background head photo.
* 1 IC front/back copy in 1 page.
* RM300 for 5 years.

Steps:
1. Go to the queue number counter. The officer will give you form if you haven't prepared and verified your items. Then he will give you queue number.
2. Wait for calling. Submit Form, 2 blue background photo and 1 IC copy.
3. Wait for calling. Submit RM300 payment. You'll get a receipt. The receipt will tell you when the new Passport is ready.
4. Come back 1 hour later, to collect the new Passport.


China Travel Visa application in Singapore

Revelent website: http://www.visaforchina.com.sg/SGP_EN/

Items to bring:
1. Fill in the ONLINE APPLICATION FORM. At the end it will produce PDF document. Print it out.
2. 1 white background head photo.
3. 1 passport copy.
4. 1 IC front/back copy.

Submit the above items to http://www.visaforchina.com.sg/SGP_EN/others/249388.shtml

China Travel Visa application in Malaysia

http://www.visaforchina.org.my/KUL_ZH/sqqzxz/index.shtml

China China Travel Visa application in Macau

Revelent website: http://www.cts.com.mo/visa/htm/vs_t3.htm

I am foreigner working in Macau, blue card holder. I cannot apply China Visa longer than my blue card expire date. So I can only apply 1/2 year multiple entries.


Items to bring:

1. Fill in 中華人民共和國簽證申請表 ( can be downloaded online https://www.google.com/search?q=%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD%E7%AD%BE%E8%AF%81%E7%94%B3%E8%AF%B7%E8%A1%A8 )
2. 1 white background head photo.
3. 1 passport copy.
4. 1 blue card front/back copy.
5. 1 employer letter showing you are working in Macau, with company seal.

Friday, July 17, 2009

Show / Extract content from HttpServlet request

The following code will extract HttpServlet request content.

System.out.println("DUMP HttpServletRequest");
java.util.Enumeration parmNames = request.getParameterNames();
int index=1;
String tem, values[] ;
int temLen; // Length of the tem String array.
while (parmNames.hasMoreElements())
{
tem = (String)parmNames.nextElement();
values = request.getParameterValues(tem);
temLen = values.length;
System.out.print("[" + (index++) + "][" + tem + "][");
for (int i=0; i < temLen; i++)
{
if (i==0)
{
System.out.print(values[i]);
}
else
{
System.out.print(", " + values[i]);
}
}
System.out.println("]");
}

index=1;
System.out.println("DUMP HttpServletRequest Attribute");
java.util.Enumeration attrNames = request.getAttributeNames();
index=1;
while (attrNames.hasMoreElements())
{
tem = (String)attrNames.nextElement();
System.out.println("[" + (index++) + "][" + tem + "][" + request.getAttribute(tem).toString() + "]");
}

Monday, June 22, 2009

Loops in Shell

http://www.softpanorama.org/Scripting/Shellorama/Control_structures/loops.shtml

Loops with PL/SQL

http://www.adp-gmbh.ch/ora/plsql/loops.html

Tuesday, May 19, 2009

Running Firefox 2 and Firefox 3 in the same machine

When doing website development, sometimes we need to see the page behaviour on both Firefox 2 and Firefox 3 for backward compatibility.

Refer to the following articles on how to setup both Firefox 2 and 3 running on the same machine.

http://blog.andreloker.de/post/2008/06/Firefox-2-and-3-side-by-side.aspx
http://www.command-tab.com/2008/06/18/how-to-run-firefox-2-and-3-simultaneously/

Friday, May 15, 2009

Open Citibank account in JB, Malaysia

Citibank branch in Johor Bahru, Malaysia.
http://www.citibank.com/locations/ap/my/johor_bahru/johor_bahru/johor_bahru_br.htm

It opens on 2nd and 4th Saturday morning.

Saving account - RM20 deposit.
Current account (with cheque book) - RM500 deposit.

Bring:
1) IC.
2) Bank statement.
3) Working proof, e.g. employment letter.

TT:
Citibank charges RM46 commision.
Overseas bank charges RM20 commision.

Citi Global Transfer - Fund transfer internationally free of service charge
Singapore - Macau (considered Citibank China)

Friday, March 27, 2009

Fatal error: Allowed memory size of xxx bytes exhausted

Source: http://forum.mamboserver.com/showthread.php?p=56808#post56808

Fatal error: Allowed memory size of 8388608 bytes exhausted

1. Edit php.ini file and restarting Apache:

memory_limit = 32M (add the line if it is missing)

2. If you do not have access to php.ini but your webspace is able to handle ".htaccess" files. Edit .htaccess file

php_value memory_limit 32M

3. Put the following line into the PHP source file.

ini_set("memory_limit","24M");