2008年4月23日 星期三

第一屆推理小說評論獎

導讀獎:
藍衣魔鬼, 黑色斷掌, 德克斯特:夢魘殺魔

解說獎
半自白, 拿破崙狂, 向日葵不開的夏天

2000至2500

一萬元獎金

稿件寄至mlrclubtw@gmail.com

存檔成doc

2008年6月10日止

計畫參加的活動

google developer day
6月14日 星期六

2008年4月22日 星期二

java 視窗最大化

public void setExtendedState(int state)

MAXIMIZED_BOTH
Concatenates MAXIMIZED_HORIZ and MAXIMIZED_VERT.

2008年4月21日 星期一

macport

help install open source programs

create partition on mac

1. fdisk -e /dev/disk4

2. auto hfs

3. w

4. newfs_hfs /dev/disk4s1

5. diskutil mountDisk disk4s1

2008年4月11日 星期五

bio_endio

void bio_endio(struct bio *bio, unsigned int nbytes, int error);
通知系統 I/O完成
nbytes表示實際傳送的bytes

struct block_device

struct gendisk * bd_disk:
Pointer to gendisk structure of the disk underlying this block device

copy_from_user

mkdev

dev_t MKDEV(unsigned int major, unsigned int minor);
Macro that builds adev_t data item from the major and minor numbers.

2008年4月10日 星期四

snmp

simple network management protocol

key components:
1. management stations(managers)
such as monitor and control network

2. network elements(Agent)
such as hosts, routers. each contains an agent

MIB( management information base)
a collection of MO( management object)
each agent maintain an MIB

SNMP service
1. get request
get the value of MO in the MIB of agent

2. get next request
get the value of next MO in the MIB of agent

3 set request
update the value of MO in the MIB of agent

4 trap request
report extraordinary events to manager

default UDP port:
manager: 162
agent : 161

OID(object identifier)

network related API

receive a message from a socket

ssize_t recvfrom (int socket, void *restrict buffer, size_t length,
int flags, struct sockaddr *restrict address,
socklen_t *restrict address_len);

ssize_t sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen);

2008年4月9日 星期三

bat檔

MD:
create directory
ex: MD test\date

2008年4月2日 星期三

ctags

/usr/local/bin/ctags --excmd=number --tag-relative=no --fields=+a+m+n+S -R `pwd`
產生程式對應的tag

作用:
找出變數/函式定義的位置
(ex: use "find definition" of BBEdit)

iWeb's data

store in userName/Library/Application Support/iWeb

constructor on inheritance

if B extends from A, when B is created ,
the constructor sequence is :
(1) A's constructor
(2) B's constructor

2008年3月31日 星期一

bento database location

Home > Library > Application Support > Bento > bento.bentodb

2008年3月30日 星期日

xcode build and gcc for universal binary

xCode
General-->Cross-Develop Using Target SDK:
Max-OS x 10.5
Then you can use features available on 10.5

build -> Architectures ( from target file):
按住mouse,之後手動輸入i386, x86_64, ppc ppc64

build --> Mac OS X Deployment Target
Mac os X 10.4
This is the minimum OS version you want to support

gcc
use -arch i386 -arch ppc
ex:
the object file generated is test.o
file test.o:
test.o (for architecture ppc7400): Mach-O object ppc
test.o (for architecture i386): Mach-O object i386

判斷 intel or power pc on mac

// for powerPC
#if __BIG_ENDIAN__
printf("big endian\n");
// for Intel
#else
printf("little endian\n");
#endif

無蝦米 on mac

(1)安裝openVanilla

(2)安裝liu3.cin到 本機硬碟>>資料庫>>OpenVanilla>>0.8.0>>Modules>>OVIMGeneric

(3)重開機

(4)open international --> openVanilla0.8.0 打勾

(5) openVanilla0.8.0-->input methods-->liu57打勾

CSS

CSS 格式

basic:
ex:
h1, h2 {
color: gray;
background: white;
}

class:
class can apply to many elements
ex:
*.warning or .warning
for each element with warning class

ex:
p.warning
for p element with warning class

the element can has more than one class
ex: <p class = "urgent warning">

串聯:
ex:
.warning.urgent
for the element with warning and urgent class
( There are problems for IE version < 7 using 串聯 )

id
use #
an id can only appear once in one HTML element
id has higher priority than class
class and id會識別大小寫

ex: *#cat = #cat
id cat applies to all elements

attribute selector:
( IE version < 7 does not support)
ex:
h1[class]
apply to <h1 class="xxx">

ex:
cat[eat]
apply to <cat eat="xxx">

ex: *[eat]
apply to all elements with eat="xxx"

串聯:
ex:
a[href][title]
apply to a element with href="xxx" and title = "xxx"

ex:
cat[eat="1"]
apply to cat with eat element = "1"

span.cat = span[class~="cat"]
apply to span element with class = "cat"

descendent selector(後代選取項)
ex:
h1 em {
color: gray;
}
apply to em element belongs to h1 element

ex:
ul ol ul em
apply to
< ul >
< ol >
< ul >
< em >

for後代選取項,選取項之間的層極可以無限大
ex: ul em
apply to
< ul >
< ol >
< ul >
< em >

選取子代組件
ex:
h1 > strong
apply only to
< h1 > < strong >
not < h1 > < em > < strong >

ex: table.sun td > p
apply to 身為td子代的p,而td是table的後代,且table的class ="sun"