吓?只是一句對不起?
單憑別人的一句對不起,你會服氣嗎?
你們的監督,打算用這種如廢物一樣的道歉方式來負責任,
哼,一把年紀,連負責任的方法也不懂嗎?
所謂的負責任 就是要有痛苦的感覺
因為自己的緣故為別人帶來麻煩,所以自己也要去承受那份痛楚
弄壞別人的銀器餐具,就要買金器餐具作為賠償
散播惡臭的工廠的社長,就要住在那個工廠的煙旁
就這是負責任
可是這世上那些所謂的高層人仕,總是不想嚐到苦果。
稍有差池,就隨便低頭認錯,一句對不起,以為這樣就可以完事。
By 渡久地東亞
One Out 可是一套既特別又有趣的漫畫,渡久地東亞地是特別的人物,
作者是甲斐谷忍,同時也是Liar Game的作者。
2009年8月16日星期日
2009年8月15日星期六
2009年8月14日星期五
container_of, offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
* @type: the type of the container struct this is embedded in.
* @member: the name of the member within the struct.
*
*/
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
This marco is very useful, it will find a pointer pointing to the containner address.
I just use it for a long time, but don't know how it works, today I am going to check it out.
The first line find a pointer __mptr pointer to the member,
second line use __mptr to substract the offset the member's offset in the container.
I like the following trick,
((TYPE *)0)->MEMBER
Cast a '0' to the containter structure pointer,
->MEMBER , will give the offset accordingly.
The marco are inside kernel.h and stddef.h
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
* @type: the type of the container struct this is embedded in.
* @member: the name of the member within the struct.
*
*/
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
This marco is very useful, it will find a pointer pointing to the containner address.
I just use it for a long time, but don't know how it works, today I am going to check it out.
The first line find a pointer __mptr pointer to the member,
second line use __mptr to substract the offset the member's offset in the container.
I like the following trick,
((TYPE *)0)->MEMBER
Cast a '0' to the containter structure pointer,
->MEMBER , will give the offset accordingly.
The marco are inside kernel.h and stddef.h
2009年8月10日星期一
setup my basic ubuntu
download latest ubuntu ISO image
$sudo passwd root
#apt-get install samba
edit /etc/samba/smb.conf
#smbpasswd -a
#apt-get install nfs-common
#apt-get install nfs-kernel-server
add /mnt/iso *(ro,sync) to /etc/exports
#apt-get install subversion
#apt-set install ssh
#apt-get install build-essential
#apt-get install libncurses5-dev
#apt-get install tofrodos
#apt-get install xinetd tftpd tftp
/etc/xinetd.d/tftp
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}
$sudo passwd root
#apt-get install samba
edit /etc/samba/smb.conf
#smbpasswd -a
#apt-get install nfs-common
#apt-get install nfs-kernel-server
add /mnt/iso *(ro,sync) to /etc/exports
#apt-get install subversion
#apt-set install ssh
#apt-get install build-essential
#apt-get install libncurses5-dev
#apt-get install tofrodos
#apt-get install xinetd tftpd tftp
/etc/xinetd.d/tftp
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}
2009年8月5日星期三
color the shell
Put this in the home directory ~/.bashrc
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
[ -e "$HOME/.dircolors" ] && DIR_COLORS="$HOME/.dircolors"
[ -e "$DIR_COLORS" ] || DIR_COLORS=""
eval "`dircolors -b $DIR_COLORS`"
alias ls='ls --color=auto'
fi
Create a file .dircolors to include the following, where I have to set
DIR 07;31;47, which means, reverse, background color is red, text color is white.
Then it is easy to differenate a directory or normal file.

# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM linux-c
TERM mach-color
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM dtterm
TERM xterm
TERM xterm-color
TERM xterm-debian
TERM rxvt
TERM screen
TERM screen-w
TERM vt100
TERM Eterm
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00 # global default, although everything should be something.
FILE 00 # normal file
DIR 07;31;47 # directory
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)
FIFO 40;33 # pipe
SOCK 01;35 # socket
DOOR 01;35 # door
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 40;31;01 # symlink to nonexistent file
# This is for files with execute permission:
EXEC 01;32
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
# If you use DOS-style suffixes, you may want to uncomment the following:
#.cmd 01;32 # executables (bright green)
#.exe 01;32
#.com 01;32
#.btm 01;32
#.bat 01;32
.tar 01;31 # archives or compressed (bright red)
.tgz 01;31
.arj 01;31
.taz 01;31
.lzh 01;31
.zip 01;31
.z 01;31
.Z 01;31
.gz 01;31
.bz2 01;31
.deb 01;31
.rpm 01;31
.jar 01;31
# image formats
.jpg 01;35
.jpeg 01;35
.gif 01;35
.bmp 01;35
.pbm 01;35
.pgm 01;35
.ppm 01;35
.tga 01;35
.xbm 01;35
.xpm 01;35
.tif 01;35
.tiff 01;35
.png 01;35
.mpg 01;35
.mpeg 01;35
.avi 01;35
.fli 01;35
.gl 01;35
.dl 01;35
.xcf 01;35
.xwd 01;35
# audio formats
.ogg 01;35
.mp3 01;35
.wav 01;35
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
[ -e "$HOME/.dircolors" ] && DIR_COLORS="$HOME/.dircolors"
[ -e "$DIR_COLORS" ] || DIR_COLORS=""
eval "`dircolors -b $DIR_COLORS`"
alias ls='ls --color=auto'
fi
Create a file .dircolors to include the following, where I have to set
DIR 07;31;47, which means, reverse, background color is red, text color is white.
Then it is easy to differenate a directory or normal file.
# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM linux-c
TERM mach-color
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM dtterm
TERM xterm
TERM xterm-color
TERM xterm-debian
TERM rxvt
TERM screen
TERM screen-w
TERM vt100
TERM Eterm
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00 # global default, although everything should be something.
FILE 00 # normal file
DIR 07;31;47 # directory
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)
FIFO 40;33 # pipe
SOCK 01;35 # socket
DOOR 01;35 # door
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 40;31;01 # symlink to nonexistent file
# This is for files with execute permission:
EXEC 01;32
# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
# If you use DOS-style suffixes, you may want to uncomment the following:
#.cmd 01;32 # executables (bright green)
#.exe 01;32
#.com 01;32
#.btm 01;32
#.bat 01;32
.tar 01;31 # archives or compressed (bright red)
.tgz 01;31
.arj 01;31
.taz 01;31
.lzh 01;31
.zip 01;31
.z 01;31
.Z 01;31
.gz 01;31
.bz2 01;31
.deb 01;31
.rpm 01;31
.jar 01;31
# image formats
.jpg 01;35
.jpeg 01;35
.gif 01;35
.bmp 01;35
.pbm 01;35
.pgm 01;35
.ppm 01;35
.tga 01;35
.xbm 01;35
.xpm 01;35
.tif 01;35
.tiff 01;35
.png 01;35
.mpg 01;35
.mpeg 01;35
.avi 01;35
.fli 01;35
.gl 01;35
.dl 01;35
.xcf 01;35
.xwd 01;35
# audio formats
.ogg 01;35
.mp3 01;35
.wav 01;35
2009年8月3日星期一
2009年8月1日星期六
VIM , ctags and supertab
唔知大家用咩editor去寫programme,ultraedit?source insight?呢d都係要俾錢,雖然有得crack,但係唔好用,唔夠快!小弟數年前有人介紹vim我用,個位人兄就係mike少,唔知佢仲有無用或者仲係未好懶咁用呢..哈哈.....我都懶用嫁,只不過好既plugin就一定要用!咁0岩轉工都要執下,順便係度介紹下啦!
plugin:
bufexplorer.vim
getscriptPlugin.vim
gzip.vim
matchparen.vim
minibufexpl.vim
netrwPlugin.vim
rrhelper.vim
ShowFunc.vim
spellfile.vim
supertab.vim
taglist.vim
tarPlugin.vim
themes.vim
tohtml.vim
vimballPlugin.vim
zipPlugin.vim
當中taglist.vim 同supertab.vim 好用到不得了。
taglist.vim 跟ctags 一起用,裝好ctags,
$ ctags -R ./
把cursor移到variable,function,marco name,按下
'ctrl'+']'
就會跳去declartion
'ctrl'+'t'
就會返回。
supertab.vim
只要按一下'tab',就會自動幫你完成長長的variable/function/marco name.....
就好似係shell 按'tab'完成file名 一樣..真係好正呀!@0@
常用command
:Tlist
:set fileformat=unix
:WMToggle
ctrl+w s
最喜愛的color scheme
metacosm.vim
小弟的_vimrc
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\ let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
colorscheme MetaCosm
let g:Tlist_Auto_Open = 1
let g:showfuncctagsbin = 'E:\work\Ctags.exe'
plugin:
bufexplorer.vim
getscriptPlugin.vim
gzip.vim
matchparen.vim
minibufexpl.vim
netrwPlugin.vim
rrhelper.vim
ShowFunc.vim
spellfile.vim
supertab.vim
taglist.vim
tarPlugin.vim
themes.vim
tohtml.vim
vimballPlugin.vim
zipPlugin.vim
當中taglist.vim 同supertab.vim 好用到不得了。
taglist.vim 跟ctags 一起用,裝好ctags,
$ ctags -R ./
把cursor移到variable,function,marco name,按下
'ctrl'+']'
就會跳去declartion
'ctrl'+'t'
就會返回。
supertab.vim
只要按一下'tab',就會自動幫你完成長長的variable/function/marco name.....
就好似係shell 按'tab'完成file名 一樣..真係好正呀!@0@
常用command
:Tlist
:set fileformat=unix
:WMToggle
ctrl+w s
最喜愛的color scheme
metacosm.vim
小弟的_vimrc
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
colorscheme MetaCosm
let g:Tlist_Auto_Open = 1
let g:showfuncctagsbin = 'E:\work\Ctags.exe'
訂閱:
文章 (Atom)