2009年12月2日 星期三

Brightness Calculator


The calculation of brightness is simple to do on single pixel. But there is no widget or tool for calculation of the average brightness of a photo. So, I wrote a simple tool for average brightness calculation, looking like as following:


The usage is simple, just clicking the "Add Files" button to pick a photo that Java supports and getting the average brightness of the photo in the table.

The link is here.

2009年6月8日 星期一

SDL on PSP

The correct method to set pixel value in a SDL_Surface is to use PixelFormat.Rshift, Gshift, Bshift, Ashift:

(*target32) = (r <<image->format->Rshift) |
(g <<image->format->Gshift) |
(b <<image->format->Bshift) |
(0x00 <<image->format->Ashift);

2009年5月21日 星期四

PSP 3007 執行自製軟體方法

福克斯前陣子買了一台 PSP 3007,而且一直觀注 Davee 大神的 blog,期待他放出破解程式。當然,在上上週,他就已經放出破解程式。不過,依著 Davee 大神的指示,福克斯一直無法進入破解模式

經過了,好幾天及上百次的測試,福克斯發現,『進入破解模式』才是最困難的一件事。

直到,福克斯看到了以下這個討論(偉大的祖國同志們寫的):
http://www.cngba.com/thread-17917309-1-1.html

所以,請大家依照上述網址中的方法進行。

其實,福克斯認為,最重要的就是:一定要把語系及語言改掉,然後『依照下面的註解,把白與黑兩張照片拿掉』。

目前,福克斯進入破解模式的機率有大於 90%。這真是太 cool 了。

2009年5月4日 星期一

WikiSpider in Traditional Chinese version

As you known, Wikipedia has a plenty of versions in many languages. I also make another configuration for Traditional Chinese(zh_TW) as the following link:

http://code.google.com/p/spiderframework/downloads/detail?name=wiki_spider_zh_TW.xml&can=2&q=#makechanges

What you need to do is just replace the spider.xml with the downloaded one, please rename it to spider.xml.

The output of this configuration file is the same with English version, the plain text of wiki page.

2009年5月3日 星期日

Web Spider for Wiki

Recently, I wrote a web spider to crawling text from wikipedia website. This spider runs at 500ms per page and saves web page as text data which reside in the center area, like the following page:


The useless information are cropped.

After saving a page, this spider clicks the "Random article" link, see blow, to get another wiki content.



I had slow this spider down for 500ms after a page. After 10,000 random pages downloaded, this spider will stop running. So, it needs more than 5,000 seconds to finished the task.

You can download the source code from http://code.google.com/p/spiderframework/downloads/list.

This is written in C# of Visual Studio 2005.

If you need the binary code directly, please email me. I can build it for you.

2009年3月20日 星期五

RGB to Gray Level 小工具

福克斯最近在研究如何在 OLED 上省電。經過一些調查發現,許多 OLED 上的省電方式多是採用灰階 (gray level) 的方式來當成參數計算。可是,福克斯之前並沒學過影像處理,就只好拜 google 大神。

在拜完後,發現了以下的這個公式:

gray level = 0.299 * R + 0.587 * G + 0.114 * B

這個公式真的很奇怪,據說是照自然界出現這三元色的比例算出來的。不過福克斯還是有點不大相信這件事。如果大家知道這三個數字是用什麼方式得到,還請跟福克斯說一聲囉。

以下就是這個小工具的畫面:


它的使用方式很簡單,只有兩個功能:
1. 轉灰階
2. 查看該點的灰階值


基本上,大家問說怎麼不做儲存,福克斯在這回答:原則上這個功能每個看圖軟體都有,而且他們多是採用 C 或 C++ 的方式寫出來的,所以效能會比較好,幹嘛不去用他們的來轉。福克斯做這個出來,僅是想做一個練習,並且開放一個範例實作出來而己。

如果大家有興趣,可以在這裡下載到原始碼

2009年3月9日 星期一

Web CSS Editor

About six years earlier, I wrote a free web CSS editor in Javascript. Honestly, I wrote it just for an exercise. And in that time, Firefox, Safari, or other browsers don't be so popular. It is only written for Microsoft Internet Explorer.

A few weeks earlier, there is a guy asking for that web CSS editor. But, I don't know where it is. After a few hours searching, I found the web CSS editor and put them in google pages:

English Version:
http://huchengtw.googlepages.com/CSS_en.zip

Traditional Chinese Version:
http://huchengtw.googlepages.com/CSS_zh_TW.rar

Hope this component helps you.

If I have free time, I will write another version to support multi-browser.

客製化 Fox Calculator 的方法

Fox Calculator 提供客製化的功能,共有:

1. Splash Image
要更換這張圖片,可以將 splash.png 換成您喜歡的圖片即可。由於 Fox Calculator 會在圖片下面顯示一段文字,建議在圖片下方留下高約 20 pixel 以上的空白。

2. Background Image
背景圖片的檔名為 background.png,這張圖片可以是任意的圖片。如果圖片大小,小於 240 x 320,Fox Calculator 會自動排列使之填滿整個畫面。

3. 各種按鈕
按鈕也是可以進行客製化的項目之一。Fox Calculator 將按鈕分成四類,
  • 0-9 及 . 使用 button1.png 及 button1_down.png。
  • +, -, *, / 使用 button2.png 及 button2_down.png。
  • Help, Sound 使用 button3.png 及 button3_down.png。
  • =, AC, C 使用 button4.png 及 button4_down.png。
其中,_down.png 結尾的圖片是使用者按下後顯示的圖片。

當然,按鈕的圖片也可以針對單一按鈕進行客製化,例如:您可以透過 0_button.png 及 0_button_down.png 來更換 0 的圖片,以下列出個每個按鈕客製化的檔名:
  • 0 ~ 9: 0_button.png, 0_button_down.png, 1_button.png, 1_button_down.png, ..., 9_button.png, 9_button_down.png
  • . : dot_button.png, dot_button_down.png
  • =: equal_button.png, dot_button_down.png
  • *: multiply_button.png, multiply_button_down.png
  • -: minus_button.png, minus_button_down.png
  • +: plus_button.png, plus_button_down.png
  • /: divide_button.png, divide_button_down.png
  • AC: ac_button.png, ac_button_down.png
  • C: c_button.png, c_button_down.png
  • Help and Close: help_close_button.png, help_close_button_down.png
  • Mute and Config: mute_config_button.png, mute_config_button_down.png
  • Nonmute and Config: nonmute_config_button.png, nonmute_config_button_down.png
4. Sound
按鈕按下去的聲音也是客製化的功能之一,預設的聲音為 click_sound.wav,您可以將之改成您喜歡的聲音檔即可。除了按鈕圖片提供單一按鈕客製化功能外,聲音也提供類似的功能,您可以利用前個項目(3. 各種按鈕)中每個按鈕客製化的命名,將 _button.png 改成 click_sound.wav 就可以針對該按鈕進行聲音的客製化,例如: equal_click_sound.wav 可以用來指定『=』按下後的聲音。

2009年3月8日 星期日

Fox Calculator 說明文件

Fox Calculator

Fox Calculator 擁有一個計算記錄表,您可以使用它來回顧之前輸入的運算式。

在 Fox Calculator 的按鈕中,有些會有多個圖示顯示其中,它代表的:按下時會執行左上方的功能;當長按(約 1.5 秒)時會執行右下方的功能。

除了顯示器上的按鈕外,您也可以使用裝置內建的 QWERTY 鍵盤來輸入,以下是按鍵與功能的對應:
0-9: 一般的數字鍵。
.: 小數點。
-: 減號運算。
+: 加號運算。
*: 乘號運算。
/: 除號運算。
=: 等號運算。
[Enter]: 等號運算,這是 enter 鍵。
c: 清除輸入。
a: 清除歷史記錄。
[ESC]: 清除歷史記錄,這是 esc 鍵。

Fox Calculator v1.1.2

您是否在操作計算機計算 10 + 20 + 83 + 28 + 82 + 77 時,常發生忘了 83 是否加過,或是其它數字是否加過的問題?

如果是,那您可以考慮使用 Fox Calculator。

Fox Calculator 提供了歷史記錄的功能,能讓您在計算的過程中,再回頭過去檢查已輸入的數字,如果一來,您將再也不會忘記之前的數用是否加過了。



Fox Calculator 是一個免費軟體,可從這裡取得。它支援 Pocket 2003 以上的版本,目前已測試過的版本有:Pocket 2003、Windows Mobile 5。

Fox Calculator 是採用 Microsoft Compact Framework 2.0 來寫成,在安裝之前,請先確定是否已經安裝 Compact Framework 2.0 或以上的版本。

如果尚未安裝,可至:http://www.microsoft.com/downloads/details.aspx?FamilyID=9655156B-356B-4A2C-857C-E62F50AE9A55&displaylang=zh-tw 安裝。