2013年1月31日 星期四

[Android] 波形分析APP

本 app 主要的目的是透過 以下三個音源

1. 手機麥克風

2. 藍芽耳機的麥克風

3. WAV 檔

產生即時的波形圖並提供 FIR 演算法濾波

顯示濾波後的波形圖,讀入的音源為 8BIT/16BIT PCM 格式







 

2012年10月19日 星期五

[Web] jquery + processing.js

用 JQuery + JQuery UI + javascript + PHP + Processing.js

製作這個網站 - drawall



讓網友可以隨手塗鴉, 分享彼此的大作

也可以以四格連環漫畫的方式創作

主要的繪圖介面當然是以 Processing.js 來作



現在 chrome, firefox 對 HTML 5 支援度已經作得滿不錯了

其它的 UI 部份全部由 JQuery + JQuery UI 製作



以 JQuery 建構網是滿方便快速, 但可能有 performance issue

不過一樣的呈現方式, 以 javascript 來寫可能也會滿複雜的

用 JQuery 撰寫時間真的縮短許多

2012年10月16日 星期二

How to make a bootloader and test with VirtualBox

Make a bootloader



以 x86 來說, BIOS 在執行完所有任務後, 最後一件事就是
搜尋 floppy, hard disk, cdrom 的 cylinder 0, head 0, sector 1
(在 hard disk 上稱做 MBR)並將該 sector (512 bytes) 載入記憶體的
0x0000:7C00 開始執行. 在 MBR 還會多檢查最後 2 bytes 是否為 0x55AA

所以我們最簡單的 boot code 如下


[BITS 16]
[org 0x7C00]

start:
mov si,MSG
call print_string
jmp $

print_string: ; Expects null terminated message in si
mov al,[si]
or al,al
jz .end
inc si
call print_char
jmp print_string
.end:
retn

print_char:
mov ah,0x0E ; Specifies that we want to write a character to the screen
mov bl,0x07 ; Specifies output text color. Not required, but useful to know
mov bh,0x00 ; Page number. Leave this alone.
int 0x10 ; Signal video interrupt to BIOS
retn

;data
MSG db 'Welcome My Operating System!',0x0A,0

TIMES 510 - ($ - $$) db 0  ; clear 0 between data and 0xAA55
DW 0xAA55



用 nasm build binary executable file


nasm -f bin -o boot.bin boot.asm



Test with VirtualBox (version: 4.2.0)

首先, 用VirtualBox新增一個虛擬機器, 類型跟作業系統可以選 Windows, Windows XP
建立完成後, 找到這個虛擬機器的 hard disk file (.vdi) 用 HEX Editor 打開
找到這個位址 0x0000:0150 如下



紅框內的值就代表這個 vdi file 的 MBR 在 0x0000:2000
接下來把 boot.bin 的 512 bytes 完全 copy 到 0x0000:2000~0x0000:21FF
就大功告成了, 開機畫面如下




Reference 

Using Virtualbox as a bootloader testing environment
X86 開機流程小記 
Operating System Development - bootloader

2012年8月28日 星期二

[Web] Custom File Button

我們常用的 html upload file 的語法
<input type="file" value="Upload" />
會產生一個普通的按鈕
如果要保留 file chooser 功能又要美化按鈕外觀的話
可以搭配 CSS


style.css

.file_button_container,
.file_button_container input {
  height: 48px;
  width: 48px;
}
.file_button_container {
  background: transparent url(images/choose_file.png) left top no-repeat;
}
.file_button_container input {
  opacity: 0;
  -moz-opacity: 0.0;
  filter: alpha(opacity=00);
}


在 html 裡, 用一個 class 為 file_button_container 的 div
包住 file button


<div class="file_button_container" id="userfile_div">
<input id="userfile" name="userfile" type="file" />
</div>



就可以了

BlueTea螢幕錄影程式

  螢幕錄影新選擇:簡單、方便、免費 現在的螢幕錄影工具多樣,但安裝麻煩、操作複雜讓人卻步。我們推出了一款全新的螢幕錄影程式,專為追求簡單和效率的你設計。 1. 免安裝 無需安裝程式。解壓縮後點兩下就可以開始使用 2. 可選取錄影範圍 自由選擇全螢幕、特定視窗或自定義區域,靈活應...