星期二, 8月 17, 2010

慢跑路線

話說最近常在台大校園慢跑, 我討厭跑操場, 所以都繞校園~
走校內空氣較好的路線.

今天達成小目標:2圈, 特此記念一下 哈哈
保持在心率150左右,2圈總計2.72 * 2 km.
大約是40分鐘跑完5.4k

跑完後神清氣爽才是有氧運動阿~
藍粗線是路線圖. 也許改天試試大安森林公園 ?


View 台北 in a larger map

星期二, 5月 18, 2010

Linux中的Type with Constant Length

許久以來,programming時常看到一堆類似的type define.

今天剛好用到,就整理一下嘍













---------------------





Linux中用户态和内核态定义了若干定长类型, 以32位无符号整数为例:





u_int32_t (BSD类型,目前netfilter中就使用这种类型)





用户态定义位于sys/types.h





在内核态见头文件include/linux/types.h





typedef __u32 u_int32_t;





uint32_t (C99类型, 内核态和用户态都能使用的类型,可移植性更好)





在用户态中见头文件/usr/include/stdint.h





在内核态见头文件include/linux/types.h





typedef __u32 uint32_t;











u32





typedef unsigned int u32;





include/asm-i386/types.h





只能在内核态使用











__u32 (Linux严格类型,内核中应该使用这种类型)





typedef unsigned int __u32;





include/asm-i386/types.h





也可以在用户态使用











unsigned long





unsigned int





标准C语言整数类型, 架构相关













----轉自周知远的博客













總結來說,推薦使用 uintxx_t 系列的C99 type.





只要include 即可。




















星期四, 4月 22, 2010

XiphQT + Fluke = Flac in iTunes

Well, since Flac is more and more popular in world of music sharing, it's time to let iTunes support Flac !

There're some trick about flac in iTunes:

First, you need to install XiphQT to play flac with Quicktime core.

Then you still need a plugin named Fluke. Since iTunes won't accept flac ether in dragging files into iTunes database or double clicking flac files, with Fluke, you could cheat iTunes to add flac when double click on flac files.



http://www.xiph.org/quicktime/download.html

http://blowintopieces.com/fluke/



星期三, 2月 24, 2010

Network Setting problem in Ubuntu 9.04

I believe many people have seen "wired device not managed" in Ubuntu network-manager in gnome.
And even if you know how to set a /etc/network/interface config file to manually start networking, you get no nothing after reboot system.
A simple way to solve this problem is set
[ifupdown] managed=true
in /etc/NetworkManager/nm-system-settings.conf to resolved the issue.

Keyboard & Mouse settings in OS X Terminal

Are you bothering with no PageUp/Down & Home/End key to use in Terminal ?
Well, just set the following keyboard mappings in OS X Terminal preferences.
And you'll get all keys work !
Key       Escape Sequence
Home      \033[1~
End       \033[4~
Page Up   \033[5~
Page Down \033[6~

Besides, if you would like to scroll terminal by mouse,  MouseTerm will be helpful.