星期日, 3月 27, 2011

Ubuntu Backup/Restore

reference from: http://ubuntuforums.org/showthread.php?t=81311

1. Gen the Tar file:
tar cvpf sendai-backup.tar --exclude=/proc --exclude=/lost+found --exclude=/sendai-backup.tar --exclude=/mnt --exclude=/sys /

2. Restore the tar to target
tar xvpf sendai-backup.tar -C /

3. mkdir the exclude dir
mkdir proc
mkdir lost+found
mkdir mnt
mkdir sys

星期三, 12月 29, 2010

MK100 Dev. Env R3

Installing Windows Embedded CE 6.0 – Steps:

1. Visual Studio 2005
2. Visual Studio 2005 SP1
3. Visual Studio 2005 SP1 for Vista
4. Windows Embedded CE 6.0
5. Windows Embedded CE 6.0 SP1
6. Windows Embedded CE 6.0 R2
7. Windows Embedded CE 6.0 R3
8. Install Windows Embedded CE 6.0_Product_Update_Rollup_2009
9. copy C:\Program Files\Common Files\microsoft shared\Windows CE Tools\Platman\target\wce600\armV4i to C:\Program Files\Common Files\microsoft shared\Windows CE Tools\Platman\target\wce600\armV4 (for active-sync)
10. device emulator 2.0
11. .net cf 2.0 sp2
12. install ARM VFPv2 library
13. install WesttekFileViewers6.exe (Office, PDF viewer)

星期一, 12月 27, 2010

Windows CE 6 FTPD, HTTPD related document

FTPD
http://msdn.microsoft.com/en-us/library/ms881874.aspx

HTTPD
http://msdn.microsoft.com/en-us/library/ee498633.aspx

星期一, 12月 20, 2010

network adb in beagleboard

since rowboat gadget driver does not works for me. so i choose use network adbd for my beagleboard-xm.

target:
setprop service.adb.tcp.port 5555
stop adbd
start adbd

windows:
adb connect xxx.xxx.xxx.xxx:5555

done.

Beagle edit boot.scr

Strip the 72byte long uboot header:
dd if=boot.scr of=boot.script bs=1 skip=72

use u-boot mkimage to gen the .scr
mkimage -A arm -T script -C none -n "beaglexm boot script" -d boot.script boot.scr

星期五, 4月 16, 2010

OMAP3 GPIO reset pin

take omap3-evm as reference

1. xxxx.h for mux

MUX_VAL(CP(GPMC_WAIT2), (IEN | PTU | EN | M4)) /*GPIO_64*/\

2. xxx.c for set h-l-h pulse

/* Make GPIO 64 as output pin */
writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);

/* Now send a pulse on the GPIO pin */
writel(GPIO0, &gpio3_base->setdataout);
udelay(1);
writel(GPIO0, &gpio3_base->cleardataout);
udelay(1);
writel(GPIO0, &gpio3_base->setdataout);

星期三, 2月 03, 2010

Platform Builder 6 remote tools

C:\Program Files\Common Files\microsoft shared\Windows CE Tools\Platman\target\wce600

copy armv4i to armv4

then VS2005(PB6) remote tools is ready.

星期二, 1月 26, 2010

Enable multi-core compiling with Visual Studio 2005/2008 for Qt

for Visual studio 2005 mkspecs\win32-msvc2005\qmake.conf
for Visual studio 2008 mkspecs\win32-msvc2008\qmake.conf

change
QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t-
to
QMAKE_CFLAGS = -nologo -Zm200 -MP -Zc:wchar_t-

Speeding up Visual C++ Qt Builds (jom)

1. extract jom binary to %QTDIR%\bin
2. run jom instead of nmake

binary stored place: ftp://ftp.qt.nokia.com/jom/

Install Qt 4.5.3 for Windows with VS2005

Install Qt 4.5.3 for Windows with VS2005

1. get qt-win-opensource-src-4.5.3.zip from ftp or file server

2. extract zip file to c:\qt\

3. cd C:\Qt\qt-win-opensource-src-4.5.3 (check the path in your system)

4. C:\Program Files\Microsoft Visual Studio 8\VC\bin\vsvars32.bat

5. configure -platform win32-msvc2005 -no-qt3support

5.1. wait for a while

6. nmake

6.1. wait for a while

7. Add system variable "QTDIR=C:\Qt\qt-win-opensource-src-4.5.3" & "PATH=C:\Qt\qt-win-opensource-src-4.5.3\bin;%PATH%"

MySQL for Qt

1. Install MySQL with development files (%QTDIR% == C:\Qt\qt-win-opensource-src-4.5.3)
2. C:\Program Files\Microsoft Visual Studio 8\VC\bin\vsvars32.bat
3. cd %QTDIR%\src\plugins\sqldrivers\mysql
4. qmake "INCLUDEPATH+='C:\Program Files\MySQL\MySQL Server 5.1\include'" "LIBS+='C:\Program Files\MySQL\MySQL Server 5.1\lib\opt\libmysql.lib'" mysql.pro
5. nmake
6. Check result. (you will see files in %QTDIR%\plugins\sqldrivers)

星期二, 10月 13, 2009

PCHK6410 development env

Installing Windows Embedded CE 6.0 – Steps:

1. Visual Studio 2005
2. Visual Studio 2005 SP1
3. Visual Studio 2005 SP1 for Vista
4. Windows Embedded CE 6.0
5. Windows Embedded CE 6.0 SP1
6. Windows Embedded CE 6.0 R2
7. Windows Embedded CE 6.0 cumulative product update package (through 12/31/2008)
8. Install Windows Embedded CE 6.0 monthly update package (since 2009/01)
9. copy C:\Program Files\Common Files\microsoft shared\Windows CE Tools\Platman\target\wce600\armV4i to C:\Program Files\Common Files\microsoft shared\Windows CE Tools\Platman\target\wce600\armV4 (for active-sync)
10. device emulator 2.0
11. .net cf 2.0 sp2

星期三, 5月 06, 2009

svn server in Linux

Create Repos:
svnadmin create ~/SVN/repos/project

then:
svn import xxx/yyy/ ~/SVN/repos/project

星期三, 7月 16, 2008

apt-get got gpgv error on debian-mipsel

1. get ntpdate
2. ntpdate time.stdtime.gov.tw
3. run `apt-get update` should be fine.

星期六, 7月 12, 2008

Qt4.4.0 + Eclipse CDT

Finally, I make my decision to transfer from Visual Stdio + Qt to Eclipse + Qt for cross-platform & singal UI.

Here is my install steps.

1. get the qt4.4.0 windows binary version. (Mingw can also installed while qt4.4.0 installing.)
2. get qt for eclipse plugin
3. get Eclipse + CDT latest version.
4. install all on C:\Develop (Qt4: c:\develop\qt4, Eclipse: c:\develop\eclipse)
5. set PATH=c:\mingw\bin;c:\develop\qt4\bin
6. set INC=c:\mingw\lib;c:\develop\qt4\lib
7. set include=c:\mingw\include;c:\develop\qt4\include
8. done

PS: debug libs are not included. user has to build by own througth 'qtvars.bat compile_debug'

reference: http://labs.trolltech.com/blogs/2007/07/11/develop-qt-applications-in-eclipse/

星期四, 7月 10, 2008

Qt4.4.0 with Visual C++ 2005 express on Windows

just a little bit different from Qt4.4.0 with VC6.

My experience about compiling Qt 4.4.0 with Visual C++ 2005 on Windows is as below.

1. Get the Qt 4.4.0 source from Trolltech
2. extrat the source pack to c:\qt4-src
3. set environment variable
PATH=%PATH%;c:\qt4\bin
QTDIR=c:\qt4
QMAKESPEC=win32-msvc2005
4. Get Platform SDK 2003 R2 & Install
5. run visual studio command mode & call %PLATFORMSDK%\setenv.bat /RETAIL
6. cd c:\qt4-src
7. copy the qt4-src/mksepc/ to qt4/mkspec
8. configure.exe -prefix c:\qt4 (see more options by using "configure -help")
9. run 'nmake' to compiling the source, wait 1hr (CPU - C2D 1.83G).
10. finally, we got what we expect.

PS: using vc 2005 compiler will get MMX, SSE, SSE2, WEBKIT support.

星期三, 7月 09, 2008

Qt4.4.0 with Visual C++ 6.0 on Windows

Qt support compiler on Windows other than Mingw from Qt 4.3.x, but user has to compile the source by own.

My experience about compiling Qt 4.4.0 with Visual C++ 6.0 on Windows is as below.

1. Get the Qt 4.4.0 source from Trolltech
2. extrat the source pack to c:\qt4-src
3. set environment variable
PATH=%PATH%;c:\qt4\bin
QTDIR=c:\qt4
QMAKESPEC=win32-msvc
4. cd c:\qt4-src
5. copy the qt4-src/mksepc/ to qt4/mkspec
6. configure.exe -prefix c:\qt4 (see more options by using "configure -help")
7. run 'nmake' to compiling the source, wait 1hr (CPU - C2D 1.83G).
8. finally, we got what we expect.

星期二, 7月 08, 2008

Debian on mipsel projects (1)

Debian commands memo:

1. debootstrap
2. debfrost
3. deborphan
4. apt-utils
5. aptitude
6. dpkg-reconfigure
7. update-rc.d
8. rcconf (like: ntsysv)
9. localpurge

Debian from scrath:
1. dfsbuild

Myth TV:

星期五, 2月 15, 2008

AlphaBlend related info

http://en.wikipedia.org/wiki/Alpha_compositing

Alpha-Blending 技术简介 <原文出處:http://dev.gameres.com/Program/Visual/2D/AlphaBlending.htm>


  现在的游戏,不管是 2D 还是 3D 的,为了追求透明光影效果,通常都会使用到 Alpha-Blending 技术。下面,我们将谈论什么是 Alpha-Blending 技术并简单介绍 Alpha-Blending 技术的具体算法。

  所谓 Alpha-Blending,其实就是按照“Alpha”混合向量的值来混合源像素和目标像素。为了便于理解,我们就从两个像素间的 Alpha-Blending 过程谈起吧。

  第一步,先把源像素和目标像素的 RGB 三个颜色分量分离,然后把源像素的三个颜色分量分别乘上 Alpha 的值,并把目标像素的三个颜色分量分别乘上 Alpha 的反值,接下来把结果按对应颜色分量相加,再对最后求得的每个分量结果除以 Alpha 的最大值(通常这一步都是用移位来完成,这亦是 Alpha 的最大值为何总是二的幂的原因),最后把三个颜色分量重新合成为一个像素输出。

  在这个过程中,为了分离像素中的 RGB 三个颜色分量,我们一般会使用掩膜的方法。至于具体的三个掩膜值:RMask、GMask 和 BMask,可以从 DirectDraw 中的 DDPixelFormat 返回得到(当然,你也可以根据自己的需要做各种灵活处理)。

  在下面给出的说明性例程中,我们假设 RMask、GMask 和 BMask 已经存放的是 RGB 三个颜色分量的位掩膜值,Alpha 的最大值为 256,而 source 和 dest 是指向源像素和目标像素的指针。

int ialpha = 256 - *alpha; // Alpha 的反值

*dest = (RMask & (((*source & RMask) * *alpha + (*dest & RMask) * ialpha) >>8)) | (GMask & (((*source & GMask) * *alpha + (*dest & GMask) * ialpha) >>8)) | (BMask & (((*source & BMask) * *alpha + (*dest & BMask) * ialpha) >>8));

  终于明白什么是 Alpha-Blending 了吧?很简单不是,快去编程一试吧。如果大家感兴趣,下次再为大家介绍几种别的混合方法。请期待『几种常用的像素混合方法』。
 

Teletext

Teletext <原文出處http://blog.sina.com.tw/roberthsiung/article.php?pbgid=39990&entryid=543510>

1970年代英國BBC新聞部開始在電視系統上提供一種文字廣播的服務,他是利用vertical blanking interva攜帶數位編碼的文字用以傳播新聞,體育或是其他生活資訊,從此將電視的用途推向更寬廣的領域.

1974年BBC新聞部開始撥送文字廣播時最多只能傳送30頁的資料,到了1976年Ceefax系統將這項服務擴充到可以提供100頁資料,很快的ORACLE及Prestel系統已都擴充到100頁,這段時間播送技術發展的很快,但是人們並沒有很快的接受,主要是因為電視本身沒有TTX Decoder而需要另裝.到了1977年第一台聚有解碼能力的電視才問世,但是要到80年代中其歐洲電視TTX解碼功能才成為15"以上電視的必備功能,這時Ceefax及CRACLE系統都已經可以提供每一頻道數百頁資訊的能力.這種文字廣播的好處曾經因為internet的蓬勃發展而手到質疑,但是2001 09 11 恐怖攻擊發生時,電話與網際網路都因雙向傳遞的特性被塞爆了,Teletext成為及時資訊的最佳傳遞媒體,同時Teletext的重要性再度被肯定.
由於TTX在歐洲的普及,他的規格也漸漸被擴充,ETSI規範Level1.5 涵蓋歐陸各種語言以及阿拉伯文與希伯萊文. level 2.5 強化顯示能力包括每個字都可以設不同的顏色,改變底色,...level 3.5 加上字型與較高解析度的圖,雖然有這麼多Level但實際上最常看到的還是level 1.5, 至於level2.5還需要特殊解碼器.
美國是一個奇怪的國家,雖然Teletext已經成功的開發出可以用在NTSC系統上,但他不屑取採用別人開發成熟的技術(雖然有些電台已經採用了,但官方不支持),自行開法只有部分功能的CC(closed caption),CC其實是Teletext開開始發展時就已經開發的基本功能.
在類比世界裡,TTX是數位編碼的資訊但都是載在視訊信號中換頁的那幾條掃描線中,反正在電視播放時那幾條是沒有視訊信號的,當解調器讀到vertical blanking interval時就把視訊載波送給TTX解碼器去解碼,然後儲存在記憶體中備用.
但是到了數位電視的時代,這部分變得有一點複雜,一開始DVB為了要支援先前的技術,公佈了DVB-TXT及DVB-VBI,在這規範中,文字廣播依然是包括在視訊封包裡,這時電視的Teletext解碼器是有功用的,因為要解讀Teletext可以使用電視的解碼器.但是這樣的服務無法發揮數位電視系統的好處,於是又公佈了DVB-SUB,將文字資訊單獨封包傳遞,這樣子就可以傳更多的文字,例如,如果是傳CC這時候就可以傳多種文字的CC,不過這時必須要由數位模組的多工解調器來處理,一般電視的TTX解調器是無作用的.甚而至於DVB-MHP或是MHEG-5這一類的middleware還處理更多更多的文字服務,這些都需要在數位機上盒中來處理,在機上盒處理完後解調成為輸出介面所要的視訊訊號讓電視做顯示,電視變成單純顯示器.
不過從另一個角度來看,數位系統可以提供的服務種類太多,每個人購買使用的功能也不同,甚至系統商也是慢慢開發出新的服務,每變更一次服務項目軟體就必須更新,因此,機上盒的軟體勢必須要常常更新,好在數位電視系統頻寬使用率比較有效率,所以軟體更新可以透過電視廣播系統遞送軟体到每個使用者的機上盒,然後自動更新.這樣對客戶服務比較好,且成本低,在客戶不尚未抱怨前把問題處理掉,客戶滿意度會比較高.