jclin::Wordpress

Sep 30, 2005

QuickDraw & CoreGraphics

Filed under: talk — jclin @ 9:33 am

ATSUI’s default is only 4-bit pixel-aligned rendering. However, on Quartz context (CoreGraphics) ATSUI uses 8-bit sub-pixel rendering. Therefore, the text rendering in Safari is better than that in Firefox.

Tags:

Sep 28, 2005

The Widget/Gfx2 redesign

Filed under: talk — jclin @ 1:18 pm

位於最新的 Mozilla CVS tree 中的 proposal.html,目錄是 mozilla/gfx2。看起來目的似乎是要重寫 Gecko 方面有關 rendering & widget 的 engine, 因為原先 Gfx 的 code 已經是好幾年前的,而現在 advanced OS GUI 都有很多加速的功能。希望中文掉字的問題能根本解決,以及畫出來的 non-western 字型能漂亮些。另外一項是要不要像 gfx 一樣實作成為 XPCOM 的元件,因為缺點就是使用 XPCOM 的話,會有太多 virtual function 的問題,造成執行速度上的 overhead。而最新的 source tree 中也包含了 Qt 的 gfx/widget,就像 KHTML 利用 Qt 來作一樣。如果能夠把 WebKit 中,Apple 自己寫 Qt classes 來包裝 Cocoa,銜接 KHTML 的 Qt classes,照這種模式拿來接 mozilla 的 Qt gfx/widget,一定很有趣。只可惜 Apple 只有實作需要用到的 Qt classes methods,並不是完整的 implementation,也無法 standalone。

Tags:

Sep 27, 2005

Notes on building Firefox

Filed under: talk — jclin @ 2:14 pm

The environment: Firefox 1.0.7, Mac OS X 10.4.2, Xcode 2.1, Fink.

  • xpcom/MoreFiles/MoreFilesX.[ch] 裡面的 FSLockRange & FSUnlockRange 名稱改掉,因為會和 Mac OS X 10.4 內已經包進來的 FSLockRange & FSUnlockRange 有 prototype conflicts,且這兩個 functions 並不會被用到,因此可以改成別的名稱,如 FSLockRange_unuse
  • modules/libreg/src/vr_stubs.c 裡面的 strdup() 會造成 link 時候與 libm.a 有重複的 conflict,因此可以把他 comment 起來
  • modules/plugin/samples/default/mac,因為 Xcode 2.1 已經改成 build/Deployment/xxx or build/Development/xxx 而不是原先的 build/xxx,因此需要 make 到一半生出來這些 binary 後,自己 ln -s Deployment/Default\ Plugin.plugin .cd DefaultPlugin.build ; ln -s Deployment/Default\ Plugin.build . 然後再繼續 make

編譯完成後,執行檔 Firefox.app 位於 dist/。

Tags: , Firefox

Sep 25, 2005

Country countdown

Filed under: talk — jclin @ 5:32 pm

位於加拿大 Roughstock Network 的 Country countdown。由 Don Steel 主持,每週可以聽到不同排名或是新進的 Country Music,網友可以透過網路票選自己最喜歡的音樂。類似國中高中時候聽中廣流行網,每個禮拜的中文流行音樂排行榜。之前,Live 是用 Windows Media Player 格式來給網路聽眾收聽,現在看到網頁上已經改成使用 RealPlayer 來收聽。在這裡可以收聽到整首完整的第一手 Country Music,不像 iTMS 的幾十秒。而台灣地區音樂公司進口的速度大概是慢 3~6 個月以上吧,或者甚至不會有。每個禮拜沒什麼空閒時時注意,而喜歡聽 Alan JacksonTim McGrawFaith HillLeAnn RimesGeorge StraitToby KeithWillie Nelson…等等歌手音樂,可以每個禮拜週末聽一下最新排行榜、新歌,更新一下資訊。

Tags: , Realplayer

Play & save MLB videos in VLC

Filed under: talk — jclin @ 12:14 am

首先利用瀏覽器開啟 URL,Firefox 會問是否啟動 MMS 相對應的程式,答否。(Safari 會直接啟動 Media Player)。接著會如畫面,出現 MMS 全部的網址。然後選取並複製該網址。

開啟 VLC,選擇功能表 File -> Open Network… 選取 HTTP/FTP/MMS/RSTP 並把剛才複製的網址貼入;並且選取下方的 advanced output 選項,並且進入 setting。

把 play locally 選項打開,則可以一邊觀看一邊存檔。另外在 File 地方填入要存檔的路徑與檔名,並且於 Encapsulation Method 選擇 ASF 格式。

都設定完畢之後,就可以一邊觀看 MLB 影片,一邊會把下載的影片封包存入檔案,看完一整場比賽或是片段 highlight,硬碟中也就多了這個存檔 ;P。當然,就算不存檔,用 VLC 看還是有很多好處。雖然說 media player 直接開啟很方便,但是用 VLC 更能享受無馬賽克狀的畫質,而且 WindowServer(CoreGraphics) 的 cpu loading 會幾乎沒有。

另外不存檔的話,也可以把 VLC 自己當成 stream server,給其他人的 player 連線觀看,如此雖僅有一個 MLB.tv account,但是也可以讓很多人在自己電腦前觀看。另外,由於 MLB 的影片是 WMV3 codec,因此 VLC 必須是內含有編譯入 VC-1 codec 的版本才行。

Tags: , MLB.tv

Sep 24, 2005

External USB HDD Box

Filed under: talk — jclin @ 9:56 am

先前買了這款 USB 介面的硬碟外接盒,跟 Mac OS X 一起用起來沒什麼問題,但是缺點感覺不少。

  1. 有小風扇設計,但是卻沒有任何氣孔,真不知道氣流要怎樣流動來散熱。
  2. 小風扇轉速應該蠻高的,但是卻固定不理想,風扇品質不佳,容易共振產生噪音。
  3. 硬碟要設成 Cable Select,否則會抓不到。

優點就是,像 USB 2.0 一樣運作正常。鄉下地方,找不到多種廠商的外接盒,看來看去還是這個算是可以接受。反正吵,就把風扇拔掉;散熱,就把前面多到像是裝飾用的 LED 前方的透明塑膠拔掉。給看倌參考參考。

screen – virtual terminal manager

Filed under: talk — jclin @ 12:43 am

screen 的常用用法與一些指令:
命令列參數:

-U: unicode
-d: detach an attached screen
-r:attach to a detached screen
-wipe: clear the dead screen(s)

screen 中的熱鍵: (^a is ctrl-a)

^a ^a   ^a key itself
^a c    create new screen window
^a 0~9- select the screen 0 to 9 & -
^a d    detach current screen
^a z    suspend current screen
^a S    split the screen into two windows
^q Q    one window mode
^a i    focus move
^a K    force kill current screen
^a x    lock screen
^a A    change the window title
^a l    refresh
^a ^g   toggle visual bell
^a ?    help
^a :    colon

useful commands in screen:

height [-w] [-d] rows [cols]:-w: window only; -d: display only
help:help screen

in ~/.screenrc

caption [always|splitonly] "%C %-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%
如抓圖的 screen 方式之用法過程
screen // start screen
irssi // run irssi in one screen
^a c // create another new screen
telnet // log in to bbs
^a S // split the screen
^a 0 // return the first screen
// resize the terminal to 36 rows
^a :height -d 36    // adjust the display height to 36 rows
^a :height -w 11    // adjust the first screen's height to 11 rows
^a ^i:              // change to the next window in the splited screen
^a :height -w 25    // adjust the bbs screen's height to 25 rows

Tags:

Sep 23, 2005

Nemesis – man in the middle

Filed under: talk — jclin @ 9:13 pm

Nemesis 是一套使用在 LAN 的工具程式。由 jclin 於大四寒假~畢業期間所開發,之後就終止開發。一來是已經用不到,二者是沒有那個網路環境可以用。發展工具為 Microsoft Visual Studio 6.0、Win32 SDK/MFC、WinPcap,環境是 Windows 2000。

Nemesis 的目的和作用是,透過 MAC spoof,把自己的電腦當作 man-in-the-middle,建立為 victim 和 gatway 之間 packet forwarding 的電腦。在使用這個程式且為運作階段,電腦的網路卡會變成 promiscuous mode,抓取全部 LAN 的封包,但是透過 Winpcap library 只擷取感興趣的 victim TCP 封包。例如有興趣的 port 是 23、25、80、和 110,那麼只會由 pcap 擷取有這些 port 的 packets,然後透過自己的電腦轉送原本 gateway⇄victim 的 packets(也就是變成gateway⇄HOST⇄victim),來達成 victim 這些 port 的網路連線正常。相對的,其他的封包則不理會,因而造成 victim 對 remote host 的其他 port 連線無法運作。利用 WinPcap 除了是封包擷取外,其實透過 Windows NDIS(Network Driver Interface Specification) API 也可以做到相同的功能,但是 WinPcap 可以讓 user 更直覺地使用命令語法,例如 port 23 or port 80 或是 not port (6881 and 4662) ,就可以達到某些 packet capture 的目的。節省 programmer 在處理 Interactive UI 和 BPF(BSD Packet Filter) 上面的時間和功夫。

由於使用 ADSL+NAT 的分享狀態,當有人狂用 P2P 下載卻不限流,會造成其他用戶很大的困擾甚至網路無法正常運作、斷線。透過這個程式,讓 victim 的一些正常 services 還是可以連線,並且限制他使用其他非允許通過之 port 的網路傳輸。因此這就是該程式主要的由來和目的。但是由於後來沒有機會繼續用該網路,也沒有測試環境,目前也大部份使用 MacOS X 而非 windows,因此中止很久的發展階段,並沒有想繼續再維護下去。透過 Open Source,如果有人能夠再行擴充或讓他更強大,倒也不失為一種方法。原始碼下載

Tags: , LAN

CopyURL+

Filed under: talk — jclin @ 12:55 pm

自從 Firefox on MacOS X 可以不掉字後,就多一點時間花在 Firefox 上,畢竟有些網頁 javascript 在 firefox 上比較沒問題。最重要的是,有很多 extension 可以使用。在 終極邊疆BLOG:複製 URL 的好工具:CopyURL+ 看到這個 CopyURL+ extension,真的是方便又蠻棒的工具。

Tags:

Solar OS

Filed under: talk — jclin @ 12:17 pm

Virtual PC Guy’s Weblog 看到的 SOLAR OS。作業系統本身非常的小,功能也很精簡,介面很類似 NextSTEP 或 OpenSTEP。但是本身是用 assembly code 寫的,因此要 port 到其他系統應該非常不簡單,而且本身需求是要 P2 等級的 CPU。因此以目前的功能和 Platform 來說,可以用 Bochs、Virtual PC、VMWare 來玩玩。

Tags:

Older Posts »

Blog at WordPress.com.