1. 软件兼容性差,可用软件少,这个估计要长时间才能改善
2. 不支持手写输入,也没键盘
3. WIFI,蓝牙支持还是屏蔽
4. 能否拍摄DV是个疑问
5. 不支持GPS
6. 不支持3G
7. 价格太高
Terror attacks in Mumbai; 80 dead, over 250 injured
MUMBAI: Terror struck the country’s financial capital late on Wednesday night
as coordinate serial explosions and indiscriminate firing rocked eight areas
across Mumbai including the crowded CST railway station, two five star hotels–Oberoi and Taj.
At
least 80 people were dead and 250 injured in the terror attacks, hospital
sources said.
vimgrep是VIM寻找模式匹配的内部方法,可以自动识别换行符和编码,并且
可以使用VIM强大的正则表达式。缺点是相对慢些,因为所有文件都要读
入内存。
语法
:vim[grep][!] /{pattern}/[g][j] {file} …
Search for {pattern} in the files {file} … and set
the error list to the matches.
Without the ‘g’ flag each line is added only once.
With ‘g’ every match is added.
{pattern} is a Vim search pattern. Instead of
enclosing it in / any non-ID character (see
|’isident’|) can be used, so long as it does not
appear in {pattern}.
‘ignorecase’ applies. To overrule it put |/c| in the
pattern to ignore case or |/C| to match case.
‘smartcase’ is not used.
When a number is put before the command this is used
as the maximum number of matches to find. Use
":1vimgrep pattern file" to find only the first.
Useful if you only want to check if there is a match
and quit quickly when it’s found.
Without the ‘j’ flag Vim jumps to the first match.
With ‘j’ only the quickfix list is updated.
With the [!] any changes in the current buffer are
abandoned.
来个简单的例子
在 d:mydocs下查找含有“弹冠相庆”的txt文档,但不跳到第一个匹配
:vimgrep /弹冠相庆/gj d:/mydocs/*/*.txt
如果要包含子文件夹,则用
:vimgrep /弹冠相庆/gj d:/mydocs/**/*.txt
打开quickfix窗口查看匹配结果
:cw
参考资料:
http://vimcdoc.sourceforge.net/doc/quickfix.html
:h vimgrep
关键词: VPD, FGAC, Row Level Security, Column-Level Privacy, dbms_rls, add_policy
下面是个简单例子 (翻译自http://www.adp-gmbh.ch/ora/security/vpd/index.html)。
在这个例子里,假设一个公司由不同的部门组成(每个部门有一条记录在department表)。一个员
工只能属于一个部门,一个部门可以有一些机密信息记录在department_secrets表。
create table department (
dep_id int primary key,
name varchar2(30)
);
create table employee (
dep_id references department,
name varchar2(30)
);
create table department_secrets (
dep_id references department,
secret varchar2(30)
);
插入一些机密信息:
insert into department values (1, ‘Research and Development’);
insert into department values (2, ‘Sales’ );
insert into department values (3, ‘Human Resources’ );
insert into employee values (2, ‘Peter’);
insert into employee values (3, ‘Julia’);
insert into employee values (3, ‘Sandy’);
insert into employee values (1, ‘Frank’);
insert into employee values (2, ‘Eric’ );
insert into employee values (1, ‘Joel’ );
insert into department_secrets values (1, ‘R+D Secret #1’ );
insert into department_secrets values (1, ‘R+D Secret #2’ );
insert into department_secrets values (2, ‘Sales Secret #1’);
insert into department_secrets values (2, ‘Sales Secret #2’);
insert into department_secrets values (3, ‘HR Secret #1’ );
insert into department_secrets values (3, ‘HR Secret #2’ );
对于任何一个员工,只能看到本部门的机密信息,而不能看见别的部门的机密信息。
为了在Oracle中实现这个功能,我们需要创建一个包,一个触发器以及设置一个策略。
首先创建一个包。
create or replace package pck_vpd
as
p_dep_id department.dep_id%type;
procedure set_dep_id(v_dep_id department.dep_id%type);
function predicate (obj_schema varchar2, obj_name varchar2) return varchar2;
end pck_vpd;
/
create or replace package body pck_vpd as
procedure set_dep_id(v_dep_id department.dep_id%type) is
begin
p_dep_id := v_dep_id;
end set_dep_id;
function predicate (obj_schema varchar2, obj_name varchar2) return varchar2 is
begin
return ‘dep_id = ‘ || p_dep_id;
end predicate;
end pck_vpd;
/
然后定义一个触发器,当用户登陆数据库时,这个触发器将被触发。它找到用户的部门id(dep_id)
并调用包里的set_dep_id存储过程。
create or replace trigger trg_vpd
after logon on database
declare
v_dep_id department.dep_id%type;
begin
select dep_id into v_dep_id
from employee where upper(name) = user;
pck_vpd.set_dep_id(v_dep_id);
end;
/
最后,定义一条策略。这条策略表明了如果用户执行一条select语句(注:实际上不止是select,
取决于policy的定义,本例中是select, update, delete),哪个存储过程返回的结果会被用来添加
到where子句中 (注:本例中是’dep_id = ‘ || p_dep_id, 其中p_dept_id会用实际值代替)。
begin
dbms_rls.add_policy (
user,
‘department_secrets’,
‘choosable policy name’,
user,
‘pck_vpd.predicate’,
‘select,update,delete’);
end;
/
为了测试上述设置,创建一些用户。
create user frank identified by frank default tablespace users temporary tablespace temp;
create user peter identified by peter default tablespace users temporary tablespace temp;
create user julia identified by julia default tablespace users temporary tablespace temp;
授予必要的权限。
grant all on department_secrets to frank;
grant all on department_secrets to peter;
grant all on department_secrets to julia;
grant create session to frank;
grant create session to peter;
grant create session to julia;
创建一个共有的别名。
create public synonym department_secrets for department_secrets;
Frank (属于R+D部门) 执行一条查询….
connect frank/frank;
select * from department_secrets;
DEP_ID SECRET
———- ——————————
1 R+D Secret #1
1 R+D Secret #2
Peter (属于Sales部门) 执行一条查询….
connect peter/peter;
select * from department_secrets;
DEP_ID SECRET
———- ——————————
2 Sales Secret #1
2 Sales Secret #2
delete, update的情况与select类似.
补充:如果要实现select时对Column-Level的控制,比如说,当查询中包含secret这个字段时所添加的
策略才生效,可以把上面的
begin
dbms_rls.add_policy (
user,
‘department_secrets’,
‘choosable policy name’,
user,
‘pck_vpd.predicate’,
‘select,update,delete’);
end;
/
改为
begin
dbms_rls.add_policy (
user,
‘department_secrets’,
‘choosable policy name’,
user,
‘pck_vpd.predicate’,
‘select,update,delete’),
sec_relevant_cols=>’secret’;
end;
/
" sytle
colo torte
" set encoding
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
" file format
set fileformats=dos,unix,mac
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" keep a backup file
set backup
" keep 100 lines of command line history
set history=100
" show the cursor position all the time
set ruler
" display incomplete commands
set showcmd
" do incremental searching
set incsearch
" In many terminal emulators the mouse works just fine, thus enable it.
if has(‘mouse’)
set mouse=a
endif
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
" backspace in Visual mode deletes selection
vnoremap <BS> d
" CTRL-X and SHIFT-Del are Cut
"vnoremap <C-X> "+x
vnoremap <S-Del> "+x
" CTRL-C and CTRL-Insert are Copy
"vnoremap <C-C> "+y
vnoremap <C-Insert> "+y
" CTRL-V and SHIFT-Insert are Paste
"map <C-V> "+gP
map <S-Insert> "+gP
" set guioptions
"set guioptions-=a
" CTRL-TAB is Next tab
noremap <C-Tab> gt
vnoremap <C-Tab> <esc>gt
inoremap <C-Tab> <esc>gt
" Shift_TAB is Previous tab
noremap <S-Tab> gT
vnoremap <S-Tab> <esc>gT
inoremap <S-Tab> <esc>gT
" Use CTRL-S for saving, also in Insert mode
noremap <C-S> :update<CR>
vnoremap <C-S> <C-C>:update<CR>
inoremap <C-S> <C-O>:update<CR>
" Don’t use ALT keys for menus.
set winaltkeys=no
" tab mapping
map <M-1> 1gt
map <M-2> 2gt
map <M-3> 3gt
map <M-4> 4gt
map <M-5> 5gt
map <M-6> 6gt
map <M-7> 7gt
map <M-8> 8gt
map <M-9> 9gt
map <M-t> :tabnew<CR>
map <M-w> :bd<CR>
map! <M-1> <esc>1gt
map! <M-2> <esc>2gt
map! <M-3> <esc>3gt
map! <M-4> <esc>4gt
map! <M-5> <esc>5gt
map! <M-6> <esc>6gt
map! <M-7> <esc>7gt
map! <M-8> <esc>8gt
map! <M-9> <esc>9gt
map! <M-t> <esc>:tabnew<CR>
map! <M-w> <esc>:bd<CR>
" display the line number
set number
" smartcase for searching
set ignorecase smartcase
" tab size
set tabstop=2
" 2 space when auto-indent
set shiftwidth=2
" replace tab with space
set expandtab
" linebreak
set linebreak
" linebreak module for asian language
set fo+=mB
" cursor keys wrap to previous/next line
set whichwrap=h,l,~,b,s,<,>,[,]
" auto indent
set autoindent
" When a bracket is inserted, briefly jump to the matching one
set showmatch
" set up statusline
set laststatus=2
set statusline=%<%f %h%m%r%=%k[%{(&fenc=="")?&enc:&fenc}%{(&bomb?",BOM":"")}] [%{&fileformat}] %-14.(%l,%c%V%) %P
"if (has("gui_running"))
" set nowrap
" set guioptions+=b
" colo torte
"else
" set wrap
" colo ron
"endif
" full screen
"au GUIEnter * simalt ~x
" set editor size
let g:editorLines=30
let g:editorColumns=125
" set editor size
function! SetScreenSize()
let &lines=g:editorLines
let &columns=g:editorColumns
endfunction
call SetScreenSize()
" get editor size
function! GetScreenSize()
let g:editorLines=&lines
let g:editorColumns=&columns
endfunction
" full screen
let g:fullScreened = 0
function! Fullscreen()
if g:fullScreened == 0
call GetScreenSize()
let g:fullScreened = 1
simalt ~x
set go-=m
set go-=T
set go-=r
set go-=b
else
let g:fullScreened = 0
call SetScreenSize()
set go+=m
set go+=T
set go+=r
set go+=b
endif
endfunction
map <F11> :call Fullscreen()<CR>
function! SaveSession()
"set sessionoptions-=curdir
"set sessionoptions+=sesdir
mksession! $VIM/session.vim
wviminfo! $VIM/session.viminfo
endfunction
map <F5> :call SaveSession()<CR>
function! LoadSession()
source $VIM/session.vim
rviminfo $VIM/session.viminfo
endfunction
map <F6> :call LoadSession()<CR>
set magic
" don’t highlight search result
map <F2> :noh<CR>
" for bufexplorer
map <F3> be
map! <F3> <esc>be
" share clipborad with windows
set clipboard+=unnamed
"When _vimrc is edited, reload it
autocmd! bufwritepost _vimrc source $VIM/_vimrc
好,下次要去泰姬陵玩玩。
所见的人都是黑人居多,印度人分四个等级(不知道现在还是不是这样),
一般来说,肤色越黑的越低级。
男的基本都是穿T shirt,衬衫,女的很多是用一匹长长的色彩鲜艳
的布把自己裹起来,腰间还要露出一坨赘肉。由于宗教的原因,还有
一些教徒用黑衣把自己整个包起来只露出眼睛,或者穿一袭白衣。
吃的东西,大部分都配有咖喱以及辣酱,中餐馆也有不少菜是这样。
肉最常见是鸡肉,羊肉也不少,猪肉牛肉基本看不到。麦当劳只有
chicken burger和fish burger,不过chicken burger里面也有咖哩。。。
还好公司旁边联系了一个中餐馆,现在已经成为我们的食堂了,厨师
的父母据说是中国人,经常搞点炒饭炒面炒青菜的改善一下伙食,
下周据说要搞个蒸整鸡,期待。在这边吃个类似于中国的纯炒青菜
有点难的,一来这里的青菜种类,二来青菜的质量也不怎么好,三来
这边的人似乎不怎么喜欢吃青菜。
关于猪肉,昨天刚在一个叫inorbit ball里的一家Ruby
Tuesday吃了猪排,吃伤了,导致最近都不会想念猪肉了。顺便说一
下这个mall,果然有点大,差不多有海岸城大小了,比我们之前看
到的都要大,号称是全孟买最大的。进去照例要做安检,可能上次
的连环爆炸的影响还没有过去。
总的来说,Mcdonals,KFC, Pizza Hut都远远没有国内的好吃,种类也
少。孟买近海,但在这里吃过的海鲜大都不怎么新鲜,有一股味道,
搞到现在都不敢吃了。
一般的印度普通老百姓都不怎么关心奥运会,不过还是经常被人问到
北京奥运会,说是最好的一届。。。
住宿条件,很一般,比国内的如家还要差点。service apartment,郊区,
因为市区太贵,面积倒挺大,有点脏,有点味道,家具家电有点旧。
刚来的时候,天天下雨,比较痛苦,近来倒是晴天居多,不下雨的孟
买可爱多了。
这里的交通非常混乱。街上的车非常多,以紧凑的车型为主。看来印度的
十几亿人口不是浪得虚名啊。有taxi,但看上去有点
破旧。最多的是一种三轮摩托车,叫auto,满大街都是,我们也经常坐。
auto的优点是方便,通风。缺点是太通风了,导致我们直接把各种
汽车的尾气以及街上各种难闻的气味都吸了个遍。大多数情况下,汽车
可以随便换道,超越,转弯以及调头。坐在auto上简直是在追求一
种惊心动魄的出行体验,因为前后左右的大车似乎随时会撞上来,把你压扁。
想念佳泰的虾蟹粥。