Li-Zhao's HomePage


I (LI Zhao) am from School of Computer Engineering, Nanyang Technological University, working in Sybase.
This is a memory book for me, so, miscellaneous topics can be found here.
Have fun!



Loading Blog Search...

Saturday, April 23, 2016

Fix HDMI audio for ubuntu/NUC

My NUC is hooked to Philips 221E via HDMI cable. The audio is fine if the monitor is never turned off. Once the monitor reboots, the distorted audio really make it unusable.

To solve the problem at ubuntu, append 'tsched=0' to 'load-module module-udev-detect' at /etc/pulse/default.pa

Wednesday, August 27, 2014

How to add extra dir to CLASSPATH at spring-boot

Spring-boot has three built-in launchers as real main classes, JarLauncher, WarLauncher and PropertiesLauncher, which could be used to call executable. These launchers set the path to load resources and classes.
Only PropertiesLauncher could be use dir outside the jar file. To add an extra dir 'EXTRA' to classpath:
1. for maven, add the following fragment
                        <plugin>
                                <groupId>org.springframework.boot</groupId>
                                <artifactId>spring-boot-maven-plugin</artifactId>
                                <configuration>
                                        <layout>ZIP</layout>
                                </configuration>
                        </plugin>
2. Use loader.path when execute the jar
java -Dloader.path="lib/,config/,EXTRA/" -jar the.jar

Then, for example, ClassPathResource("1.properties") could get 1.properties from EXTRA dir.

Thursday, April 03, 2014

Lost 3 years

I forgot to migrate my wordpress DB from an expired hosting plan, and the posts from 2001-2004 are lost.

But, well, one word could cover most of the life: babysitter.

Tuesday, February 01, 2011

Lens dropped

Visited universal studio yesterday, a wonderful place.
But, unlucky, my wife lost the lens cap; 1 hour later, the 17-55 lens got dropped, and UV glass is broken, the UV ring is dented. By quicky googling, I found guys spent hours to DIY remove the dented UV.
So, I gave up the chance to do it myself, instead, it's sent to canon service centre today. They helped me to remove the dented UV in 15mins, even gave me a free lens cap.
Huh, the service is great, thanks.

Friday, June 25, 2010

update from redhat RHEL4 to CentOS5.5

I have a virtual machine running RHEL4 on our cluster server. But IT does not support it anymore. So, I tried to update it to CentOS to enjoy update.
The problem is I have no physical access to the VM, so need to update online.
Neither Redhat nor CentOS suggest to do online update between major releases, but no choice. I did in 2 steps:

  1. migrate from RHEL4 to CentOS4
  2. update from CentOS4 to CentOS5

Step1 works like charm, but the 2nd step is nightmare. I followed this article: http://planet.admon.org/howto/update-centos-4-to-centos-5-remotely/ because it is the longest one I found. :D I guess it is more comprehensive.
all the steps before 'yum upgrade' is OK, but yum upgrade tried to dump mega error messages (e.g., matchpathcon /.../... failed invalid argument) to my remote terminal, and lasted for more than 10mins, util I pressed ctl+c. Then it left a messy system to me.
What I tried to fix the issue:
  1. package-cleanup --leaves (then manually yum remove the packages)
  2. package-cleanup --cleandupes
  3. yum upgrade (run several times with removing of conflict reported)
Now, the system seems normal.

Saturday, June 12, 2010

Thursday, June 03, 2010

Drunk son

Huh, he just finished a whole bottle of milk.

Thursday, December 10, 2009

HOWTO: when you lost DPP CD

I cannot find my canon DPP install CD, and Canon website provides DPP updater only.
DPP updater runs only on PC with DPP installed. If you have the following contents at registry table, then it thinks you have DPP installed.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Canon\DPP]
[HKEY_LOCAL_MACHINE\SOFTWARE\Canon\ZoomBrowser EX\]
[HKEY_LOCAL_MACHINE\SOFTWARE\Canon\EOS Capture]
[HKEY_LOCAL_MACHINE\SOFTWARE\Canon\EOSViewerUtility]
[HKEY_LOCAL_MACHINE\SOFTWARE\Canon\PhotoStitch]


Some lines are for other updater.

For ZoomBrowser 6.3+, please change "ZoomBrowser EX" to "ZoomBrowser EX\Install".

Wednesday, December 09, 2009

Google wave invitation to send

Who want to try the wave? I have couples of invitations, please leave your email, if you want one.
Leave anonymous comments, then, your email won't be displayed.

Monday, June 22, 2009

B超对照表

copied from http://blog.sina.com.cn/s/blog_4ae0fa1d0100b3ex.html~type=v5_one&label=rela_nextarticle http://blog.sina.com.cn/s/blog_4ae0fa1d0100b3f5.html~type=v5_one&label=rela_nextarticle

  • 怀孕: Pregnancy
  • 预产期: Date of delivery; Due date
  • 害喜: Morning sickness
  • 胎儿心音: Fetal Heart Sounds
  • 破水: Membrane Rupture / Water broken
  • 阵痛: Labor Pain
  • 早期破水: Premature Rupture
  • 腿抽筋: Leg Cramp
  • 胎儿: Fetus
  • 胎动: Fetal Movement; Quickening
  • 妊娠纹: Striations of Pregnancy (common saying: strech mark)
  • 羊水过多: Polyhydramnion
  • 产道: Birth Canal
  • 阴道检查: Internal (Vaginal) Examination
  • 分娩: Delivery
  • 子宫收缩: Contraction
  • 子宫收缩: Contraction
  • 会阴切开: Episiotomy
  • 会阴缝合: Perineorrhaphy Stitch
  • 产后: After Birth
  • 脐带: Umbilical Cord
  • 胎盘: Placenta
  • 恶露: Lochia
  • 早产: Premature Birth
  • 胎盘前置: Placenta Praevia
  • 胎盘分离: Separation of the Placenta
  • 盘卷脐带: Coiling of the Umbilical Cord
  • 骨盆狭窄: Narrow Pelvic
  • 会阴裂伤: Laceration of the Perineum
  • 子宫破裂: Tubal Rupture
  • 产褥热: Puerperal Fever
  • 剖腹产: Caesarean Section
  • 产钳助产: Forceps Delivery
  • 母乳喂养: Brest Feeding
  • 人工喂养: Bottle Feeding
  • 初乳: Colostrum
  • 新生儿: Newborn Baby
  • 见红:The bloody show
  • 肚脐:belly button
  • 臂位:breech position
  • B超:ultrasound
  • 宫高:fundal height
  • 羊水:amniotic fluid
  • 孕周:gestational weeks
  • 足月妊娠:term
  • 骨盆:pelvis
  • 产程发动:onset of labor
  • 先兆临产:threatened labor
  • 产程:parturient
  • 初产妇:primipara
  • 胎位:fetal position
  • 宫缩:uterine contraction
  • 宫内生长迟缓:intrauterine growth retardation (IUGR)
  • 小于胎龄:small for gestational age (SGA)
  • 大于胎龄:large for gestational age (LGA)
  • 巨大儿:macrosomia
  • 过期妊娠:prolonged pregancy
  • 过期:overdue (postdate)
  • 过熟postmaturity
  • 胎儿窘迫fetal distress
  • 胎心过缓fetal bradycardia
  • 胎心过速fetal tachycardia
  • 胎心心律不齐fetal heart irrythmia
  • 羊水粪染meconium-staining amniotic fluid
  • 会阴切开术episiotomy
  • GS—胎囊
  • FE—胎芽:早期胎儿
  • CRL—头臀长:为胎儿头与臀之间的距离,表示胎体纵轴平行测量最大的长轴,主要用于判定孕7~12周的胎龄。
  • FH—胎头:轮廓完整为正常,缺损、变形为异常,脑中线无移位和无脑积水为正常。
  • BDP—胎头双顶径:胎儿头部左右两侧之间最宽部位的长度,又称为“头部大横径”。孕足月时应达到9.3厘米或以上。按一般规律,在孕5个月以后,基本与怀孕月份相符,也就是说,妊娠28周(7个月)时BPD约为7.0厘米,孕32周(8个月)时约为8.0厘米,以此类推。孕8个月以后,平均每周增长约为 0.2厘米为正常。当初期无法通过CRL来确定预产日时,往往通过BPD来预测;中期以后,在推定胎儿体重时,往往也需要测量该数据。
  •  APTD —— 腹部前后间的厚度,又称为“腹部前后径”。在检查胎儿腹部的发育状况以及推定胎儿体重时,需要测量该数据。
  • H—胎心:B超于怀孕7-8周、最早孕6周末可见胎心跳动。胎心跳动的频率正常为每分钟120-160次之间。
  • FL—股骨长度:是胎儿大腿骨的长度,又称为“大腿骨长、股骨长”。指胎儿大腿根部到膝部间股骨的长度。它的正常值与相应的怀孕月份的BPD值差2-3厘米左右,比如说BPD为9.3厘米,股骨长度应为7.3厘米;BPD为8.9厘米,股骨长度应为6.9厘米等。一般在妊娠20周左右,通过测量FL来检查胎儿的发育状况
  • SP—脊椎:孕12周后可见胎儿脊柱,孕20 周则清晰可辨。胎儿脊柱连续为正常,缺损为异常,可能脊柱有畸形。
  • FM—胎动:B超于孕8~9周就可见到胎动。有、强为正常,无、弱可能胎儿在睡眠中,也可能为异常情况,要结合其他项目综合分析。
  • Cord—脐带:正常情况下,脐带应漂浮在羊水中,如在胎儿颈部见到脐带影像,可能为脐带绕颈。
  • PL—胎盘:位置是说明胎盘在子宫壁的位置;正常足月胎盘的厚度应在2.5-5厘米之间。
  • GP ( 胎盘分级):一般胎盘分为0,I ,II,III级。Ⅰ级为胎盘成熟的早期阶段,回声均匀,在怀30-32周可见到此种变化;Ⅱ级表示胎盘接近成熟;Ⅲ级提示胎盘已经成熟,胎盘内有很多钙化点,表现为小砂粒状,一般不对胎儿生命构成威胁,但应引起重视。越接近足月,胎盘越成熟,回声的不均匀。
  • AC —— 腹围
  • AMN—羊水:
  •   MVP( 最大羊水池垂直羊水深度)在3-7厘米之间为正常,超过7厘米为羊水增多,少于3厘米为羊水减少。
  •   AFI ( 羊水指数)以孕妇的脐部为中心,分上,下,左,右4区域,将4个区域的羊水深度相加,就得到羊水指数,孕晚期羊水指数的正常值是8~18厘米。超过18厘米为羊水增多,少于8厘米为羊水减少。AFI在判断羊水多少方面更科学一些。
  •   S/D (A/D)— 胎儿脐动脉收缩压与舒张压的比值与胎儿供血相关,当胎盘功能不良或脐带异常时此比值会出现异常,在正常妊娠情况下,随孕周增加胎儿需要增加S下降,D升高,使比值下降,近足月妊娠时S/D小于3。
  • 胎儿B超单常见缩写还有
  • TCD: 小脑横径
  • HL —— 肱骨长
  • HC: 头围
  • FTH: 胎儿腿部皮下脂肪厚度
  • LOA ,ROA,LOP,ROP;LSA,RSA等——表示胎位的英文缩写。L=Left 左,R=Right 右,A=Anterior 前,P=Posterior 后,O=Occiput 枕骨,S=Sacrum 骶骨,SC=Scapula 肩。表示胎位,如:左枕前(LOA) 左枕横(LOT) 左枕后(LOP) 右枕前(ROA) 左骶前(LSA)右骶前(RSA)等。
  •   胎儿体重的估算值Y(g)公式如下:
  •   公式1: Y=-4973.72+260.69HC
  •   公式2: Y=-2686.60+171.48AC
  •   公式3: Y=-2232.56+747.42FL
  •   公式4: Y=-2513.51+1049.90FTH
  •   公式5: Y=-5168.32+100.97HC+110.86AC+143.09FL+331.43FTH
  •   可以使用其中任一个公式计算,公式5的精度最高

Wednesday, November 12, 2008

Develop Browser Plugin based on Windows Mobile

NPAPI is supported by various Web browser engines, such as WebKit and Gecko. Iris browser is a WebKit based Web browser that can run on Windows Mobile. So, we could extend Iris with NPAPI plugin.

I am not sure whether Iris provide develop environment for plugin. We might need to find another way to build plugin.

What I tried first is to build minimo, and study whether can build plugins based on minimo. Unfortunately, seems minimo does not support plugins well. Anyway, I write down my experiment for reference.

  • Build minimo
minimo is the minisized Mozilla running on Windows Mobile, and I guess it is a good start point to build plugin, as all its codes are available. http://www-archive.mozilla.org/projects/minimo/WinCE/build.html gives the steps to build minimo. Here, just add some points:
  1. I met the problem@http://forums.mozillazine.org/viewtopic.php?f=47&t=553405, solved by adding one line ac_cv_static_assertion_macros_work=yes before the line of "if eval "test \"`echo '$''{'ac_cv_static_assertion_macros_work'+set}'`\" = set"; then". I do not know the reason, and after it pass, and I revert the configure to original version, it still works
  2. on Windows Vista, \moztools\bin\nsinstall.exe requires administrator right, so, I run console by administrator to build.
  3. Then I met another issue: SEE_MASK_FLAG_DDEWAIT and SEE_MASK_INVOKEIDLIST undefined in nsOSHelperAppService.cpp, solved by using patch from https://bugzilla.mozilla.org/show_bug.cgi?id=402948
It takes 1~2 hours on my DualCore 1.86G Dell Precision PWS390 to build minimo.
  • qtWebKit as plugin development SDK

Although minimo runs smoothly on my emulator, but I found it does not support plugins (if I am wrong, let me know, tkz). qtWebKit is the Windows Mobile port of WebKit engine. It's the next candidate I tried. Please goto http://code.staikos.net/ for latest sources.

I download qtwebkit 4.5 from SVN repository http://svn.webkit.org/repository/webkit/trunk, version 37064. http://git.webvm.net/ provides npsimple, a simple plugin sample running on Windows Mobile.

I built npsimple with VS2008, after setting include directory in the project. Please make sure the directory setting contains those with npruntime.h and npfunctions.h. For the qtWebKit I downloaded, they are:

  1. WebCore\bridge
  2. WebCore\plugins

To try the plugin, I installed Iris browser based on WebKit to my Window Mobile emulator (WM5)(http://www.torchmobile.com/blog/?p=5), and then copy the built plugin to plugins folder under where I install Iris browser (http://www.torchmobile.com/blog/?p=9).

All done! Just open the html coming with npsimple project and see the result.

Monday, September 01, 2008

PdfEdit -- the strongest open source PDF editor.

There is no budget for me to study into Acrobat's pdf editor in detail, so, I do not know whether PdfEdit is weaker or stronger than it.

But based on my experience, I just recommend PdfEdit as your pdf editor, especially if you do not bother do a little script programming.

Here, I give an example of how could you change all pages' size with PdfEdit.

Step1: goto 1st page, and decide the desire page size: In this example, we change the left margin to 50, the effect on 1st page is:

Step2: goto 1st page again, if you want to change page 1-6's size to (50,0,595.2,841.92), then input the scripts to script window and press enter to execute it, that's all:

for(i=0;i<6;i++)

{
page().setMediabox(50,0,595.2,841.92);
PageSpace.nextPage();
}
page().setMediabox(50,0,595.2,841.92);

For more samples of PdfEdit script, you can refer to .ps files in PdfEdit home dir, e.g., ubuntu install it to /usr/share/pdfedit/.
Detailed script API can be found at: http://pdfedit.petricek.net/appendix.html

Monday, August 04, 2008

WinDbg theme

I just follow tess blog to setup the windbg theme. For reuse, the theme can be exported to windbg.reg (HKEY_CURRENT_USER\Software\Microsoft\Windbg\Workspaces), so that you can recover it easily.

Saturday, May 10, 2008

Google services down in Singapore?

Nothing special is at this weekend, but I cannot access google services (google search, google reader, etc.) today.
It's funny that I must revert to yahoo/msn to do search.

Thursday, November 15, 2007

Maemo Mapper 2 for n770

Maemo mapper 2 supports 770, and can download map easily. I am staying in Singapore, and the map I downloaded includes: 1. 1'28"04.66N/103'41"10.47E to 1'17"48.99N/103'52"04.18E 2. 1'25"29.74N/103'52"04.18E to 1'17"48.99N/103'58"57.12E 3. 1'17"48.99N/103'44"37.56E to 1'14"20.82N/103'54"15.55E These areas does not cover whole Singapore, but should be more than enough for me.

Saturday, November 10, 2007

N810 application is accepted

I found the email when I got up this afternoon, :D, and so glad that I haven't read the news from maemo news Web site. Otherwise, I might think my application hasn't be accepted.

For sure, it's a great deal to buy such an amazing gadgets with 99Euro, and what also makes me happy is maemo thank contributors in this way.

Thanks, maemo.

Thursday, September 20, 2007

How to create a blogger feed for a given category

Blogger publish ATOM feed for recent posts by default, including posts from all categories.
To publish a feed with only posts from a given category is also very simple. For example, in a blogger site http://blog.lizhao.net/ with category named 'maemo', the feed is:
http://blog.lizhao.net/feeds/posts/default/-/maemo
For more discussion about the format, plz refer to another article

Monday, September 17, 2007

make minimo maemo more stable

MicorB for ITOS2007HE may be on the way, but who knows when will it finally arrive. Based on the waiting experience, I decided to reinstall minimo, while waiting it.

When I tried minino 1 mth ago, it is not stable on 770, but I also heard if increase memory buffer size, it can perform much better. So, I try to set the buffer size to 4096 or 8192, according to mozilla site.

On 770, just run: vi /home/user/.mozilla/minimo/prefs.js and add one line:
user_pref("browser.cache.memory.capacity", 8192);
trying google calendar/reader/gmail for a while, yea, it is much more stable, but an annoying bug is still there.
I feel if there is unknown errors happened in rendering a page, the corresponding tab can not be closed, or refresh, and it will affect other tabs.
If anybody know how to solve this, plz tell me. :-)
try: user_pref("network.http.max-connections", 8); and user_pref("network.http.max-connections-per-server", 4);

Display Icon in Maemo Application Manager

After making a deb package for maemo platform, and depolying it to a repository recognized by Maemo application manager, it is valuable to let application manager display a interesting icon beside the package name.

There are several points need to note:

  1. encode a 26x26 png image into base64 format, this can be done by: uuencode -m xxx_26x26.png /dev/stdout . Then the encoded texts (between the 1st and the last line) will be used in package.
  2. embed the texts into debian/control, in a section named: XB-Maemo-Icon-26. There must be a space before each line in this section.
  3. run dpkg-scanpackages to generate Packages.gz, and make sure the XB-Maemo-Icon-26 section is also copied into Packages.gz
Actually, application manager display icon based on the base64 data found in Packages.gz.

However, I found dpkg-scanpackages of some versions dismiss the icon section. For these versions, here is the workaround:

change:

dpkg-scanpackages ....... > .../Packages.gz

to:

dpkg_scanpackages="/tmp/dpkg_scanpackages-$$"
cat $BIN_SCANPACKAGES | $BIN_SED -e "s/('Package',/('Package', 'Maemo-Icon-26',/" > $dpkg_scanpackages #this is for dpkg-scanpackage 1.3
cat $dpkg_scanpackages | $BIN_SED -e "s/Size MD5sum Section Priority Description))/Size MD5sum Section Priority Description Maemo-Icon-26))/" > $dpkg_scanpackages #this is for dpkg-scanpackage 1.4
chmod 755 $dpkg_scanpackages

$dpkg_scanpackages ....... > .../Packages.gz

Monday, September 03, 2007

Free Video Converter for Home DVD player

Most DVD players sold today have DivX support, I think. So, it is a good choice to convert videos to DivX and enjoy thems in sofa.

The free version of any video converter do the job quite well.

You may want to test the video converted with DivX Player before burning CDs.