2010-12-21

Regular Expression 測試 3 (Regular Expression Test 3)

只利用 Regex 來測試字串是否符合日期格式



共 512 個字元

Regular Expression 測試 2 (Regular Expression Test 2)

只利用 Regex 來測試字串是否符合 IPv4 格式



共 158 個字元

2010-12-19

Regular Expression 測試 1 (Regular Expression Test 1)

只利用 Regex 來測試字串是否符合24小時制時間格式



共 80 個字元

2010-11-27

更改 Ubuntu 的 Button Layout (Modify button layout in Ubuntu)

Ubuntu10.04+ 的按鈕排放在左邊,變成與 Mac OS 相似的設定
這種設定使部分習慣使用 Windows 或各種 Linux (安裝 X Window System) 的用家或多或少構成不便
Ubuntu 允許使用者更改按鈕的擺放位置
The button layout move to the left side in Ubuntu10.04+, like Mac OS
This settings inconvenience the tranditional user of Windows or Linux (install with X Window System)
Ubuntu allow user to modify the button layout

PHP UTF-8 編碼與 session 及 header 問題 (Solving BOM of UTF-8 File Encoding problem with PHP session and header)

網絡上不少跨語言網頁大部分都是以 UTF-8 作為編碼
但利用 UTF-8 編碼編寫 PHP 文件使用到 session 及 header 時便會發生問題
UTF-8 編碼的文件會在文件檔頭加上 3個bytes 的資料,這 3個bytes 稱為 BOM - Byte Order Mark
在標準制式下 UTF-8 的這 3個bytes 分別是:
第一個byte - 0xef
第二個byte - 0xbb
第三個byte - 0xbf
UTF-8 is a popular File Encoding on the internet.
However, when we use UTF-8 with PHP using session and header there are some error occurs.
UTF-8 file has 3 bytes of data at the beginning of file, this 3 bytes called BOM - Byte Order Mark
The standard of UTF-8 file of this 3 bytes is:
1st byte - 0xef
2nd byte - 0xbb
3rd byte - 0xbf

2010-11-17

Windows VISTA / Windows 7 不能使用 VBScript 的 CommanDialog (VBScript CommonDialog in Windows VISTA and Windows 7)

不少人在 Windows 處理簡單的程序時,往往會用到 VBScript
而使用 VBScript 涉及檔案存取時不少人都會想到使用 File Dialog 讓使用者有一個具 GUI 的檔案選擇工具
VBScript is a light, useful programming language (script) in Windows OS
We can write a VBS with notepad or any text editor
We always select a file with File Dialog
File Dialog is a user-friendly GUI for user to select a specific file

2010-10-18

利用 PEAR 製作 Excel 檔案 (Use PEAR to create an Excel file)

PEAR 為 PHP Extension and Application Repository 的簡稱
是一種以 PHP 物件導向的設計的程式庫
PEAR is the abbreviation of PHP Extension and Application Repository

2010-10-11

Bio Hazard Remake / Resident Evil Remake Chris Invisible Enemy Hard

Bio Hazard / Resident Evil Remake Chris Invisible Enemy Hard Part 01

Bio Hazard Remake / Resident Evil Remake Chris Real Survival

Bio Hazard / Resident Evil Remake Chris Real Survival Part 01

Bio Hazard Remake / Resident Evil Remake Chris New Game

Bio Hazard / Resident Evil Remake Chris New Game Part 01

Bio Hazard Remake / Resident Evil Remake Jill Invisible Enemy Hard

Bio Hazard / Resident Evil Remake Jill Invisible Enemy Hard Part 01

Bio Hazard Remake / Resident Evil Remake Jill Real Survival

Bio Hazard / Resident Evil Remake Jill Real Survival Part 01

Bio Hazard Remake / Resident Evil Remake Jill New Game

Bio Hazard / Resident Evil Remake Jill New Game Part 01

Bio Hazard Zero (Ø) / Resident Evil Zero (Ø) Hard

Bio Hazard / Resident Evil Zero Hard Part 01

Bio Hazard Zero (Ø) / Resident Evil Zero (Ø)

Bio Hazard / Resident Evil Zero Part 01

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 Extra Series

Bio Hazard / Resident Evil Outbreak File 2 Elimination 1 Very Hard Nightmare Part 1

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 Very Hard Series

Bio Hazard / Resident Evil Outbreak File 2 Stage 1 Very Hard Part 1

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 Hard Series

Bio Hazard / Resident Evil Outbreak File 2 Stage 1 Hard Part 1

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 Normal Series

Bio Hazard / Resident Evil Outbreak File 2 Stage 1 Normal Part 1

Bio Hazard Outbreak / Resident Evil Outbreak Very Hard Series

Bio Hazard / Resident Evil Outbreak Stage 1 Very Hard Part 1

Bio Hazard 4 / Resident Evil 4 The Another Order / Separate Ways

Bio Hazard / Resident Evil 4 The Another Order / Separate Ways 01

Bio Hazard 4 / Resident Evil 4 Zero Hit Ratio

Bio Hazard / Resident Evil 4 Zero Hit Ratio 01

Bio Hazard 4 / Resident Evil 4

Bio Hazard / Resident Evil 4 01

2010-10-03

Bio Hazard Code Veronica Complete / Resident Evil Code Veronica X

Bio Hazard / Resident Evil Code: Veronica Complete Version Part 01

Bio Hazard 3 / Resident Evil 3 Knife No Damage Clear

Bio Hazard / Resident Evil 3 Knife No Damage Clear Part 01

Bio Hazard 2 / Resident Evil 2 Leon B Knife (Almost) Clear

Bio Hazard / Resident Evil 2 Leon B Knife (Almost) Clear Part 01

Bio Hazard 2 / Resident Evil 2 Claire A Knife Clear


Bio Hazard / Resident Evil 2 Claire A Part 01

Bio Hazard 2 / Resident Evil 2 Claire B Knife (Almost) Clear

Bio Hazard / Resident Evil 2 Claire B Knife (Almost) Clear Part 01

Bio Hazard 2 / Resident Evil 2 Leon A Knife Clear

Bio Hazard / Resident Evil 2 Leon A Knife Clear Part 01

Bio Hazard 2 / Resident Evil 2 Leon B

Bio Hazard / Resident Evil 2 Leon B Part 01

Bio Hazard 2 / Resident Evil 2 Claire A

Bio Hazard / Resident Evil 2 Claire A Part 01

Bio Hazard 2 / Resident Evil 2 Claire B

Bio Hazard / Resident Evil 2 Claire B Part 01

Bio Hazard 2 / Resident Evil 2 Leon A

Bio Hazard / Resident Evil 2 Leon A Part 01

Bio Hazard / Resident Evil Jill Arrange

Bio Hazard / Resident Evil Jill Arrange Part 01

Bio Hazard / Resident Evil Chris Arrange

Bio Hazard / Resident Evil Chris Arrange Part 01

Bio Hazard / Resident Evil Jill Arrange Knife (Almost) Clear

Bio Hazard / Resident Evil Jill Arrange Knife (Almost) Clear Part 01

Bio Hazard / Resident Evil Chris Arrange Knife (Almost) Clear

Bio Hazard / Resident Evil Chris Arrange Knife (Almost) Clear Part 01

Bio Hazard / Resident Evil Jill

Bio Hazard / Resident Evil Jill Part 01

2010-10-02

Bio Hazard / Resident Evil Chris

Bio Hazard / Resident Evil Chris Part 01

Bio Hazard / Resident Evil Jill Original Knife (Almost) Clear

Bio Hazard / Resident Evil Jill Original Knife (Almost) Clear Part 01

Bio Hazard / Resident Evil Chris Original Knife (Almost) Clear


Bio Hazard / Resident Evil Jill Original Knife (Almost) Clear Part 01

2010-07-20

在 Ubuntu 安裝 NVIDIA Display Card Driver

雖然在 Ubuntu 可以利用預設的驅動程式安裝
但有時 Ubuntu 對於太新的硬件未有預設的驅動程式
甚至在 GUI 畫面的 System > Administration > Hardware Driver 都找不到相關資料
便需要到 NVIDIA 的官方網站下載相應的驅動程式 http://www.nvidia.com/

2010-07-17

改變 BURG 主題的圖示

見下文
主題的圖示選單項目並不能表達所有作業系統
如延伸自 Ubuntu 的 KUbuntu 、 XUbuntu 及所以 Windows 等
一律都當為相同的作業系統,因此在 BURG 的選單中不能分別
除非加上文字描述
但透過以下方法便可以自訂一些圖示

2010-07-13

在 Ubuntu 中設定 GRUB2

見下文
使用 Ubuntu9.10 預設的 GRUB2 是一個很簡單的黑白界面
透過以下資料修改 GRUB2 讓 GRUB2 更加美觀
但注意,若有任何不正當改動最嚴重可導致 GRUB2 不能起動

2010-07-07

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 突破達成率 (End Of The Road Completion)

「決意」達成率的條件

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 死守達成率 (Desperate Time Completion)

「死守」達成率的條件

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 記憶達成率 (Flashback Completion)

「記憶」達成率的條件

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 異界達成率 (Underbelly Completion)

「異界」達成率的條件

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 咆哮達成率 (Wlid Things Completion)

「咆哮」達成率的條件

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 Extra

Collections - Extra 的獲得條件與支給分數

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 Music

Collections - Music 的獲得條件與支給分數

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 Movie

Collections - Movie 的獲得條件與支給分數

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 Costume

Collections - Costume 的獲得條件與支給分數

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 Gallery

Collections - Gallery 的獲得條件與支給分數

2010-07-02

Bio Hazard Outbreak / Resident Evil Outbreak 決意達成率 (Decision, Decision Completion)

「決意」達成率的條件

Bio Hazard Outbreak / Resident Evil Outbreak 獄炎達成率 (Hellfire Completion)

「獄炎」達成率的條件

Bio Hazard Outbreak / Resident Evil Outbreak 巢窟達成率 (The Hive Completion)

「巢窟」達成率的條件

Bio Hazard Outbreak / Resident Evil Outbreak 零下達成率 (Below Freezing Point Completion)

「零下」達成率的條件

Bio Hazard Outbreak / Resident Evil Outbreak 發生達成率 (Outbreak Completion)

「發生」達成率的條件

Bio Hazard Outbreak / Resident Evil Outbreak Extra

Collections - Extra 的獲得條件與支給分數

Bio Hazard Outbreak / Resident Evil Outbreak Music

Collections - Music 的獲得條件與支給分數

2010-06-03

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 咆哮 (Wild Things) SP Items

「咆哮」SP Item 的獲得條件及地方

利用 Java 將 Zip 格式解壓縮 (Use Java to decompress a ZIP file)

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public static void decompress(File source, File destination) throws IOException{
    if (!destination.exists() || destination.isDirectory()){
        destination.mkdirs();
        ZipInputStream zis = new ZipInputStream(new FileInputStream(source));
        byte[] buffer = new byte[1024];
        for (ZipEntry zip; (zip = zis.getNextEntry()) != null;){
            File file = new File(destination, zip.getName());
            if (zip.isDirectory()){
                file.mkdirs();
            } else {
                FileOutputStream fos = new FileOutputStream(file);
                for (int length; (length = zis.read(buffer)) > 0;){
                    fos.write(buffer, 0, length);
                }
                fos.close();
            }
            zis.closeEntry();
        }
        zis.close();
    }
}

利用 Java 將檔案與資料夾壓縮成 Zip 格式 (Use Java to compress file(s) or directory(ies) as ZIP format)

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.zip.Deflater;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

public static void compress(File source, File destination) throws IOException{
    compress(source, destination, null, Deflater.DEFAULT_COMPRESSION);
}

public static void compress(File source, File destination, String comment, int level) throws IOException{
    ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(destination));
    zos.setComment(comment);
    zos.setLevel(level);
    compress(zos, source.getParent(), source);
    zos.flush();
    zos.close();
}

private static void compress(ZipOutputStream zos, String rootpath, File source) throws IOException{
    String filename = source.toString().substring(rootpath.length() + 1);
    if (source.isFile()){
        zos.putNextEntry(new ZipEntry(filename));
        FileInputStream fis = new FileInputStream(source);
        byte[] buffer = new byte[1024];
        for (int length; (length = fis.read(buffer)) > 0;){
            zos.write(buffer, 0, length);
        }
        fis.close();
        zos.closeEntry();
    } else if (source.isDirectory()){
        zos.putNextEntry(new ZipEntry(filename + "/"));
        zos.closeEntry();
        File[] files = source.listFiles();
        for (File file : files){
            compress(zos, rootpath, file);
        }
    }
}

2010-05-27

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 SP Items List

所有 SP Item 的獲得條件

Bio Hazard Outbreak / Resident Evil Outbreak 決意 (Decision, Decision) SP Items

「決意」SP Item 的獲得條件及地方

Bio Hazard Outbreak / Resident Evil Outbreak 獄炎 (Hellfire) SP Items

「獄炎」SP Item 的獲得條件及地方

Bio Hazard Outbreak / Resident Evil Outbreak 巢窟 (The Hive) SP Items

「巢窟」SP Item 的獲得條件及地方

Bio Hazard Outbreak / Resident Evil Outbreak 零下 (Below Freezing Point) SP Items

「零下」SP Item 的獲得條件及地方

2010-05-18

利用 Java 獲取文件的編碼類型 (Use Java to get the file encoding)

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 回復藥物 (Recover Items)

遊戲中所有回復藥物的組合、圖像及名單

Bio Hazard Outbreak / Resident Evil Outbreak 回復藥物 (Recover Items)

遊戲中所有回復藥物的組合、圖像及名單

Bio Hazard Outbreak File 2 / Resident Evil Outbreak File 2 物品 (Items)

遊戲中所有物品的組合、圖像及名單

Bio Hazard Code Veronica / Resident Evil Code Veronica 地圖 (Map)

地圖一覽

2010-05-08

利用 Java 採取畫面圖像 (Use Java to capture the system screen image)

import java.awt.AWTException;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.IOException;

2010-04-29

Google Chrome OS 試用

由 Google 開發的 Chrome OS

可能暫時未有正式及具體的編譯教學
大部分在網路上可下載 Chrome OS 暫時都是由專業 Linux 使用者
經由 VMWare 所編譯的虛擬硬碟檔 (*.vmdk)
幸好 VMWare 的 VMWare Player 可免費下載安裝使用 (Macintosh 則使用 VMWare Fusion)
而 VMWare Player 3 還可以建立虛擬硬碟檔,能運行 VMWare Station 之類需要收費的工具的部分簡單功能

2010-04-27

Windows Live SkyDrive 的批次下載問題 (Batch download files in Windows Live SkyDrive)

即使將文件名稱有規律地上載到 Windows Live 的 SkyDrive 中
要批次下載存放 SkyDrive 中的文件依然不能
Although upload the file and named with regular order to SkyDrive
You still cannot batch download the files

2010-04-26

R-Type Final Fighter 101

previousnext
Number: 101
Model: R-101
Code: Grand Finale
獲得條件:
使用 100 30分鐘
How to get:
Using Fighter 100 30 minutes

見下文
全 Beam 、全 Force 、全 Missile 、全 Bit ,任意選擇
previousnext

R-Type Final Fighter 100

previousnext
Number: 100
Model: R-100
Code: Curtain Call
獲得條件:
密碼(日/韓) 9910 0101
密碼(美/歐) 1009 9201
How to get:
Password (Japan/Korean) 9910 0101
Password (USA/European) 1009 9201

見下文
全 Beam 、全 Force 、全 Missile 、全 Bit ,任意選擇
previousnext

R-Type Final Fighter 099

previousnext
Number: 099
Model: R-99
Code: Last Dancer
獲得條件:
獲得 001 至 098 後遊戲時間經過 1分鐘
How to get:
Get Fighter 001 to 098 after 1 minutes

見下文
全 Beam 、全 Force 、全 Missile 、全 Bit ,任意選擇
previousnext

R-Type Final Fighter 097

previousnext
Number: 097
Model: B-5C
Code: Platinum Heart
獲得條件:
使用 096 15分鐘
How to get:
Using Fighter 096 15 minutes

見下文

R-Type Final Fighter 098

previousnext
Number: 098
Model: B-5D
Code: Diamond Wedding
獲得條件:
使用 097 30分鐘
How to get:
Using Fighter 097 30 minutes

見下文

R-Type Final Fighter 096

previousnext
Number: 096
Model: B-5B
Code: Golden Selection
獲得條件:
使用 095 5分鐘
How to get:
Using Fighter 095 5 minutes

見下文

R-Type Final Fighter 094

previousnext
Number: 094
Model: BX-4
Code: Arvanche
獲得條件:
獲得 092 後遊戲時間經過 30分鐘
How to get:
Get Fighter 092 after 30 minutes

見下文

R-Type Final Fighter 095

previousnext
Number: 095
Model: B-5A
Code: Claw Claw
獲得條件:
使用 094 5分鐘
How to get:
Using Fighter 094 5 minutes

見下文

R-Type Final Fighter 093

previousnext
Number: 093
Model: B-3C2
Code: Sexy Dynamite II
獲得條件:
使用 092 15分鐘
How to get:
Using Fighter 092 15 minutes

見下文
Beam
見下文
Force
見下文
Force Attack
見下文見下文見下文
Missile
見下文見下文見下文
Bit
見下文見下文
previousnext

R-Type Final Fighter 092

previousnext
Number: 092
Model: B-3C
Code: Sexy Dynamite
獲得條件:
獲得 090 後遊戲時間經過 30分鐘
How to get:
Get Fighter 090 after 30 minutes

見下文
Beam
見下文
Force
見下文
Force Attack
見下文見下文見下文
Missile
見下文見下文見下文
Bit
見下文見下文
previousnext

R-Type Final Fighter 089

previousnext
Number: 089
Model: B-3A2
Code: Misty Lady II
獲得條件:
使用 088 15分鐘
How to get:
Using Fighter 088 15 minutes

見下文

R-Type Final Fighter 090

previousnext
Number: 090
Model: B-3B
Code: Metallic Dawn
獲得條件:
獲得 087
完成 F-B
How to get:
Get Fighter 088
Complete F-B

見下文

R-Type Final Fighter 091

previousnext
Number: 091
Model: B-3B2
Code: Metallic Dawn II
獲得條件:
使用 090 15分鐘
How to get:
Using Fighter 090 15 minutes

見下文

R-Type Final Fighter 087

previousnext
Number: 087
Model: BX-2
Code: Platonic Love
獲得條件:
獲得 084 後遊戲時間經過 30分鐘
How to get:
Get Fighter 084 after 30 minutes

見下文

R-Type Final Fighter 088

previousnext
Number: 088
Model: B-3A
Code: Misty Lady
獲得條件:
使用 087 5分鐘
How to get:
Using Fighter 087 5 minutes

見下文

R-Type Final Fighter 086

previousnext
Number: 086
Model: B-1D3
Code: Bydo System γ
獲得條件:
使用 085 15分鐘
How to get:
Using Fighter 085 15 minutes

見下文

R-Type Final Fighter 083

previousnext
Number: 083
Model: B-1C3
Code: Amphibian III
獲得條件:
使用 082 15分鐘
How to get:
Using Fighter 082 15 minutes

見下文

R-Type Final Fighter 085

previousnext
Number: 085
Model: B-1D2
Code: Bydo System β
獲得條件:
使用 084 5分鐘
How to get:
Using Fighter 084 5 minutes

見下文

R-Type Final Fighter 084

previousnext
Number: 084
Model: B-1D
Code: Bydo System α
獲得條件:
獲得 081 後遊戲時間經過 30分鐘
How to get:
Get Fighter 081 after 30 minutes

見下文

R-Type Final Fighter 082

previousnext
Number: 082
Model: B-1C2
Code: Amphibian II
獲得條件:
使用 081 5分鐘
How to get:
Using Fighter 081 5 minutes

見下文