×

欢迎光临,有什么想法就留言告诉我吧!

你的精彩评论可能会出现在这里哦! 留言抢沙发

杂项

xpath怎么过滤元素

穆琪 穆琪 发表于2024-01-05 浏览291 评论0

要使用XPath过滤掉属性不等于某种名称的元素,可以使用not()函数和@class属性来实现。

//div[not(@class='aaa')]  // XPath表达式,过滤掉class不等于aaa的div元素
它将匹配具有class属性不等于aaa的div元素。not()函数用于否定条件,@class表示class属性。

杂项

vim配置备份

穆琪 穆琪 发表于2023-08-30 浏览532 评论0
" vundle config
set nocompatible              " required
filetype off                  " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'https://github.com/scrooloose/nerdtree'
Plugin 'kien/rainbow_parentheses.vim'
Plugin 'https://github.com/bling/vim-airline'
" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)
" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" user config
" 通用配置
syntax on
set ic
set hlsearch
set encoding=utf-8
set fileencodings=utf-8,ucs-bom,GB2312,big5
set cursorline
set autoindent
set smartindent
set scrolloff=4
set showmatch
set nu
" python文件配置
let python_highlight_all=1
au Filetype python set tabstop=4
au Filetype python set softtabstop=4
au Filetype python set shiftwidth=4
au Filetype python set textwidth=79
au Filetype python set expandtab
au Filetype python set autoindent
au Filetype python set fileformat=unix
autocmd Filetype python set foldmethod=indent
autocmd Filetype python set foldlevel=99
" 分割窗口配置
set splitbelow
set splitright
" split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" 代码折叠
set foldmethod=indent
set foldlevel=99
nnoremap <space> za
" 文件树配置
nnoremap <F3> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" 括号匹配颜色配置
let g:rbpt_colorpairs = [
                        \ ['brown',       'RoyalBlue3'],
                        \ ['Darkblue',    'SeaGreen3'],
                        \ ['darkgray',    'DarkOrchid3'],
                        \ ['darkgreen',   'firebrick3'],
                        \ ['darkcyan',    'RoyalBlue3'],
                        \ ['darkred',     'SeaGreen3'],
                        \ ['darkmagenta', 'DarkOrchid3'],
                        \ ['brown',       'firebrick3'],
                        \ ['gray',        'RoyalBlue3'],
                        \ ['darkmagenta', 'DarkOrchid3'],
                        \ ['Darkblue',    'firebrick3'],
                        \ ['darkgreen',   'RoyalBlue3'],
                        \ ['darkcyan',    'SeaGreen3'],
                        \ ['darkred',     'DarkOrchid3'],
                        \ ['red',         'firebrick3'],
                        \ ]
let g:rbpt_max = 16
let g:rbpt_loadcmd_toggle = 0
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces

杂项

kafka查看topic的偏移量

穆琪 穆琪 发表于2023-05-12 浏览156 评论0
1. 列举消费者
./kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list
2. 查看偏移量
./kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group consumer --describe
3. 移动至最新
./kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group multi-alarms-pro --topic Alarms --reset-offsets --to-latest -execute
Git Merge 与 Git Rebase的区别

杂项

Git Merge 与 Git Rebase的区别

穆琪 穆琪 发表于2023-04-28 浏览120 评论0

1.背景

merge和rebase都是用于分支合并,但实现机制不同。

git merge是将两个分支的修改合并成一个新的提交,并保留两个分支的历史记录;

git rebase是将一个分支的修改应用到另一个分支上,使得两个分支的修改看起来像是顺序提交的。

接下来,通过图形的方式直观地介绍git merge和git rebase的工作过程。

2.合并(Merge)

git merge是将一个分支的修改融入到另一个分支的一种方式,可执行两种类型的合并:fast-forward 和 no-fast-forward,现在你可能分不清,不过没关系,我们马上来看看它们的差异所在。