2011-12-29

在 MySQL 計算年齡 (Calculating Age in MySQL)

儲存個人資料時,由於年齡是一種跟隨時間而變動的資料,因此合理情況上不會儲存年齡
取而代之會以出生日期為儲存資料,便可以透過日期相減計算出年齡
When recording an user data, age is an dynamic data. Generally, you should not store it.
So you store the date of birth, then calculating the age from date of birth.

2011-12-07

讓 SciTE 顯示中文字

SciTE 是一個強勁的文字編輯器,其跨平台性被人稱為 Linux 版 Notepad++
另外由於它同樣使用文字文件作為配置文件,可以非常簡單修改設定,基本 SciTE 本身便可以修改自身的設定

2011-11-22

使用 Google Chrome 下載 Flash 媒體播放器的影像

網絡上有不少外掛程式,下載 Youtube 的影片
但網絡上除了 Youtube 還有不少網站提供媒體播放,但這些網站卻不像 Youtube 有外掛程式來下載其媒體檔案
是不是沒有方法下載這是媒體檔案 ?

FFmpeg 使用 libmp3lame 函式庫的問題 (The problem of FFmpeg when using libmp3lame library)

FFmpeg 是一種強大的影音格式轉換工具,大部分免費(不一定開源)影音處理軟件都會使用 FFmpeg
FFmpeg 的背後還有不斷更新、強化的巨大函式庫,函式庫大部分也是免費、開源的
其中經常使用的 MP3 音訊格式也是調用 libmp3lame 函式庫所編碼而成

2011-11-21

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

自從 Microsoft 更新了 Windows Live SkyDrive 後
每次上載的檔案由每個 50MB 增加至每個 100MB,而下載速度相當快,平均有 2~3Mbps
但上載速度便不敢恭維了,3 個 100MB 檔案便會發生 Timeout,看來 SkyDrive 仍有進步空間
但在此文章,主要不是討論這些問題

2011-10-18

2011-10-16

Bio Hazard 3 / Resident Evil 3 迴避技巧 (Dodging)

迴避是 Bio Hazard 3 中新增的功能,是能夠有效迴避敵人發動的攻勢。
尤其迷你遊戲 The Mercenaries 以刀作主要武器的 Nicholai ,迴避不單能減少傷害 (或減少受傷機會) ,而且能增加時間,因此熟習迴避是 Bio Hazard 3 的首要課題。

批次處理程序的字串功能 (Function of String in Batch)

Windows 擁有優良的界面控制,但如果涉及大量重覆性的運作
使用界面並不合適,因此便需要使用批次處理程序
Windows provides a good quality of GUI, but, if you would like to do a large number of repetitive operations,
GUI is not appropriate, so we need to use the batch process

2011-09-26

Bio Hazard / Resident Evil Code Veronica Battle Game 評分 (Ranking)

角色SABCD
Claire~ 06'09"9906'10"00 ~ 06'19"9906'20"00 ~ 06'29"9906'30"00 ~ 06'39"9906'40"00 ~
賽車女郎Claire~ 07'58"9907'59"00 ~ 08'59"9909'00"00 ~ 09'59"9910'00"00 ~ 10'59"9911'00"00 ~
Chris~ 06'29"9906'30"00 ~ 08'29"9908'30"00 ~ 09'29"9909'30"00 ~ 10'29"9910'30"00 ~
Steve~ 09'59"9910'00"00 ~ 12'29"9912'30"00 ~ 13'29"9913'30"00 ~ 14'29"9914'30"00 ~
Wesker~ 59'59"99----

2011-09-13

2011-08-21

Dino Crisis 物品 (Items)

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

Dino Crisis 回復藥物 (Recover Items)

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

Dino Crisis 武器與子彈 (Weapons and Bullets)

遊戲中所有武器與子彈的組合、圖像及名單
及本人對武器與子彈的主觀分析與描述

避免使用者利用 SSH 登入 (Prevent User SSH Login)

當你分享的你的 Linux 使用者帳戶,讓其他使用者存取你的電腦
例如登入你的 FTP (不提供匿名登入)
你便需要提供你的使用者名稱及密碼給其他使用者
同時會讓你的系統帶來危險,如果對方使用其他正在執行的 Daemon 例如 SSH
When you want to share your Linux user account to allow other user to access your computer
For example, login your FTP (Ignore the anonymous login)
You will provide the user account name and password for other user.
However, on that time your system will be in danger if the user wants to access to your computer with other daemon, such as SSH.

2011-08-09

在 Linux 中將光碟資料轉換成 ISO 檔案 (Convert CD/DVD ROM to ISO file in Linux)

光碟很容易受到物理損壞導致資料遺失
若果光碟所保存的資料只是一堆獨立檔案,只需要將它們複製至硬碟中便可以保存
但若果那是一隻安裝光碟,隨便將檔案複製,檔案資料有機會不能正常運作
若果能夠建立 ISO 檔案,便可以隨時透過映像檔錄製光碟
Disc is easy to lose data if taking physical damages
If the disc is store with data files independently, just copy the files to the harddisk to backup the data
However, if the disc is an install disc, although the files are copied, some of them cannot be functioned
If back up a disc with an ISO file, we can write a disc on any time with any disc writer

2011-07-30

利用 GRUB2 讀取 Ubuntu ISO (Using GRUB2 to load Ubuntu ISOs)

每次安裝新系統都要燒錄光碟吧……很浪費呢……
用外置裝置吧……要將裝置中的資料備份,再格式化裝置,再將映像檔寫入……
但若果沒有以上的裝置,哪如何安裝新系統?
If you want to install a new system to your harddisk,
You need write a install disc, it is a little bit waste.
Use external device ... you need to backup the data in this external device,
format the external device, build the image to the external device ...
However, if you don't have these devices, how could you install a new system ?

2011-07-11

實用的 7-Zip 指令

7-Zip 是一種跨平台、開放源碼、免費、強大的壓縮工具

但是,7-Zip 只在 Windows 提供界面,若使用其他作業系統,例如 Linux 及 Macintosh 便沒有界面
當然你仍然可以使用其他具有界面,能整合 7-Zip 的壓縮工具
但若果你在完全沒有用戶界面的情況下,如何使用 7-Zip 壓縮資料?

2011-06-29

利用 Java 發送 HTTP POST 請求 (Using Java to send HTTP Request with POST method)

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;

2011-06-06

讓 Spreadsheet Excel Writer 的字串斷行 (Line Break in Spreadsheet Excel Writer)

先編寫一個使用 Spreadsheet Excel Writer 輸出 Excel 檔案的 php 文件
並在儲存格中加入 \n 來將字串
Write a simple PHP file using Spreadsheet Excel Writer to export Excel file
見下文

2011-03-23

在 OpenOffice.org Calc 重覆列印列或欄 (Repeat printing row(s) or column(s) in OpenOffice.org Calc)

見下文
格式 -> 列印範圍 -> 編輯
選取合適的範圍、重覆的列或欄,然後按確定
但有時會出現錯誤
Format -> Print Ranges -> Edit
Select the suitable range, repeat row(s) or column(s), then press OK
However, sometimes an error will occur

2011-03-09

恢復 Ubuntu 的音量控制台 (Restore Ubuntu Volume Control Panel)

當升級 Ubuntu 系統後,有機會遺失音量控制台的快速啟動
雖然可以從 系統 > 偏好設定 > 聲音 來設定音量
這方法雖然可行,但只調整音量的情況下,顯得比較繁複
Sometimes after Upgrade your Ubuntu System, Volume Control Panel will be lost.
Although you can configure your System Volume in System > Preferences > Sound Preferences,
It is a tedious method that only increase, decrease or mute the volume.
見下文

2011-02-24

使用 Java 上載檔案至 FTP 伺服器 (Use Java to upload file to FTP Server)

import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import sun.net.TelnetOutputStream;
import sun.net.ftp.FtpClient;

2011-01-11

為 Ubuntu 增加字型 (Add font types in Ubuntu)

將字型檔案放置在 /usr/share/fonts/truetype
不過為了容易整理文件,建議先在 /usr/share/fonts/truetype 中建立一個資料夾

2011-01-01

讓 Windows Bootloader 載入 GRUB

為避免格式化 Ubuntu 後導致不能起動 Windows ,所以不讓 GRUB 成為 MBR
但使用 Windows 預設的 Bootloader 又不能列出非 Windows 的作業系統,所以需要改寫 C:\boot.ini
注意:胡亂改寫 C:\boot.ini 的會導致所有作業系統不能起動
If you use GRUB as MBR, after format Ubuntu partition GRUB will erase also
However, after re-build Windows Bootloader as MBR, GRUB2 will be replaced, and Ubuntu cannot be started for booting
So, how could let Windows Bootloader as MBR and boot up Ubuntu after GRUB2 is replaces

修復 Ubuntu 的 MBR (Recover Ubuntu GRUB as MBR)

GRUB 是一種出名的 Bootloader
但當 GRUB 被其他 Bootloader 覆蓋,如何重新讓 GRUB 成為 MBR ?
GRUB is a popular Bootloader.
However, how could we recover GRUB is covered by other Bootloader ?

修復 Windows 的 MBR (Recover Windows Bootloader as MBR)

若電腦系統曾經運行 Windows 與 Ubuntu 雙系統
當 Ubuntu 被格式化後,由於會連同 GRUB 一拼刪除,若果 MBR 被 Ubuntu 覆寫 MBR 不會引導 Windows 的 Bootloader
因此將會導致沒有 Bootloader 起動 Windows
若要重新起動 Windows 便需要修復 MBR 引導 Windows 的 Bootloader
If the computer run with Windows and UBunut 2 Systems
After you format Ubuntu, you should recover Windows Bootloader as Master Boot Record, otherwise you cannot boot to Windows Partition
You need to recover Windows Bootloader to boot the Windows Partition