Group Details

二次元爱好者

用爱发电~

  • 尝试一下码云的挂件功能...

    star
    Fork me on Gitee
    Bruce Kang/prime

    posted in 编程
  • RE: 《GIBIATE》这番是我最近看过的最烂的番

    第11话

    真就剧情全靠乱编呗
    博士和BOSS都是外星人,BOSS是博士的妻子,外星的兴亡把她变成了怪物,博士为了救妻子研制疫苗(我就先不吐槽疫苗治病这个bug了)
    你说你研制疫苗也就算了,为什么还要先研制一个能增强怪物能力的药?
    然后主角团在打BOSS,博士不去阻止,埋头继续研制疫苗。
    然后主角团把BOSS杀了,博士刚好研制完疫苗,赶到现场,然后开始讲故事,然后说我没有目标了,我要反水,主角都去死吧(我:???)
    我寻思好几集之前BOSS出现的时候你怎么不说?就为了剧情强行不说?

    还有这一集彻底把第一集的设定吃了,2个主角团成员被GIBIA刺中,只要几秒就可以被同化。说好的5小时呢?

    然后主角团开始排队送死
    A:我来阻止他!...A卒
    众(站着不动):A你怎么死了!...B卒
    众(站着不动):B你怎么死了!...C卒
    (其实因为出场太少,我连ABC是谁,叫什么名都记不清了)


    难道新冠肺炎还会影响智商?祝愿病魔早日战胜制作组人员。

    posted in 二次元
  • RE: 是谁说Dvorak布局适合程序员的...

    @Bruce 稍微改变了一下按键方式,现在是用右手无名指去按=\了,舒服多了

    posted in 编程
  • Go的OOP就是个残废

    前言:因为最近Go很火,我之前关注的一个编辑器也是用Go写的,所以我打算自学一下Go语言
    结果,我发现Go完全没有某些人吹嘘的那么好,OOP部分无论是实现方式还是代码体验简直就是一坨翔,写起来甚至和C有点像。
    定义方法其实就是定义函数,只不过函数的第一个参数是结构体(Go中甚至没有类的概念),和C函数唯一的区别就是把结构体参数提前到函数名前了:

    // 之前写C++比较多,不保证代码规范符合Go的标准
    type foo struct {
    }
    
    func (f foo) method(params types) (returns) {
        // function body
    }
    
    func main() {
        bar := new(foo)
        params := "blabla"
        bar.method(params)
    }
    
    

    至于继承,直接把父结构嵌套在子结构中就算继承了:

    type parent struct {}
    
    type child struct {
        parent
    }
    

    接口的继承也是嵌套,而接口的实现居然是靠赋值,并且官方工具目前好像还不支持静态检查:

    type i interface {
        foo()
    }
    
    type s struce {}
    
    func (bar s) foo() {}
    
    func main() {
        a := s{}
        var b i = a
        b.foo()
    }
    

    写了半天,我还以为我回到了上个世纪写C的年代。恕我直言,C++的OOP做的都比Go好!

    posted in 编程
  • 是谁说Dvorak布局适合程序员的...

    体验了大约一周,已经能达到20词/分的龟速了...中排键位已经记住了
    Programmer Dvorak没试过,用的是Dvorak标准版,布局如下
    dvorak.jpg
    这几天用下来的感觉就是,右手小拇指累出天际了!

    虽然编程常用的"',.<>分布在了左手区上排,:;分布在了左手小拇指下排,但是右手区分布对程序员来说却极不合理
    html需要经常用的连字符-,编程需要经常用的等号加减号下划线=+-_,斜杠反斜杠/\,撤回需要按的z,全部需要用右手小拇指按,并且需要移动,有的甚至还需要长距离移动。尤其是=,绝对是编程最常用的符号。
    刚才打了200行代码,现在小拇指疼得不行。

    刚才看了下Programmer Dvorak,=在数字键6的位置说实话也不是很舒服,而且字母区保持了普通版dvorak的布局我认为是一个败笔。显然,程序员的字母输入频率是和打字员不一样的,但是function的fc,new的w,main的mversion的v,json的j,return的r,都没有分布在中排,有的甚至分布在很难按到的位置。


    综上所述,我认为Dvorak布局被过誉了,至少对于程序员来说,它并不算好用

    posted in 编程
  • RE: 推荐一下我的vim配置

    @Bruce 持续折腾中...把万年不更新的Vundle换成了vim-plug

    • 使用新的vim-plug进行插件管理
    • 使用coc.nvim以及各种插件进行代码补全
      8WFR_BBO@PJ_XV0DLY_U_A8.png
    set nocompatible
    
    call plug#begin('~/.vim/plugged')
    
    Plug 'neoclide/coc.nvim', {'branch': 'release'}
    Plug 'tomasiser/vim-code-dark'
    Plug 'tpope/vim-fugitive'
    Plug 'vim-airline/vim-airline'
    Plug 'honza/vim-snippets'
    Plug 'octol/vim-cpp-enhanced-highlight'
    
    " All of your Plugins must be added before the following line
    call plug#end()
    
    let g:coc_global_extensions=['coc-cmake', 'coc-json', 'coc-python', 'coc-html', 'coc-tsserver', 'coc-snippets', 'coc-highlight']
    
    let g:cpp_class_scope_highlight=1
    let g:cpp_member_variable_highlight=1
    let g:cpp_class_decl_highlight=1
    let g:cpp_posix_standard=1
    let g:cpp_experimental_simple_template_highlight=1
    let g:cpp_concepts_highlight=1
    
    " coc completion settings
    inoremap <silent><expr> <TAB>
        \ pumvisible()? coc#_select_confirm() :
        \ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
        \ <SID>check_back_space()? "\<TAB>" :
        \ coc#refresh()
    
    function! s:check_back_space() abort
        let col = col('.') - 1
        return !col || getline('.')[col - 1] =~# '\s'
    endfunction
    
    let g:coc_snippet_next='<tab>'
    
    filetype plugin indent on
    
    set t_Co=256
    set t_ut=
    colorscheme codedark
    set laststatus=2
    set nowrap
    
    set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
    set nu
    set smartindent
    
    set cursorline
    set cc=81
    
    inoremap ' ''<ESC>i
    inoremap " ""<ESC>i
    inoremap ( ()<ESC>i
    inoremap [ []<ESC>i
    " inoremap < <><ESC>i
    inoremap ` ``<ESC>i
    inoremap { {}<ESC>i
    
    let g:airline#extensions#hunks#enabled=0
    let g:airline#extensions#branch#enabled=1
    
    if !exists('g:airline_symbols')
        let g:airline_symbols = {}
    endif
    let g:airline_symbols.space = "\ua0"
    
    
    posted in Linux
  • RE: 推荐一下我的vim配置

    @Bruce 用插件tpope/vim-fugitivevim-airline/vim-airline替换了状态栏,现在省去了一堆函数和状态栏配置
    vim效果图.jpg
    现在的最新配置是:

    set nocompatible              " be iMproved, 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 'VundleVim/Vundle.vim'
    
    " The following are examples of different formats supported.
    " Keep Plugin commands between vundle#begin/end.
    
    " plugin on GitHub repo
    " Plugin 'tpope/vim-fugitive'
    
    " plugin from http://vim-scripts.org/vim/scripts.html
    " Plugin 'L9'
    
    " Git plugin not hosted on GitHub
    " Plugin 'git://git.wincent.com/command-t.git'
    
    " git repos on your local machine (i.e. when working on your own plugin)
    " Plugin 'file:///home/gmarik/path/to/plugin'
    " The sparkup vim script is in a subdirectory of this repo called vim.
    " Pass the path to set the runtimepath properly.
    
    " Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
    " Install L9 and avoid a Naming conflict if you've already installed a
    " different version somewhere else.
    " Plugin 'ascenator/L9', {'name': 'newL9'}
    
    Plugin 'Valloric/YouCompleteMe'
    Plugin 'tomasiser/vim-code-dark'
    Plugin 'tpope/vim-fugitive'
    Plugin 'vim-airline/vim-airline'
    
    " All of your Plugins must be added before the following line
    call vundle#end()            " required
    filetype plugin indent on    " required
    " To ignore plugin indent changes, instead use:
    "filetype plugin on
    "
    " Brief help
    " :PluginList       - lists configured plugins
    " :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
    " :PluginSearch foo - searches for foo; append `!` to refresh local cache
    " :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
    "
    " see :h vundle for more details or wiki for FAQ
    " Put your non-Plugin stuff after this line
    
    set t_Co=256
    set t_ut=
    colorscheme codedark
    set laststatus=2
    set nowrap
    
    set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
    set nu
    set smartindent
    
    set cursorline
    set cc=81
    
    inoremap ' ''<ESC>i
    inoremap " ""<ESC>i
    inoremap ( ()<ESC>i
    inoremap [ []<ESC>i
    " inoremap < <><ESC>i
    inoremap ` ``<ESC>i
    inoremap { {}<ESC>i
    
    let g:ycm_key_invoke_completion='<c-z>'
    set completeopt=menu,menuone
    let g:ycm_add_preview_to_completeopt=0
    let g:airline#extensions#hunks#enabled=0
    let g:airline#extensions#branch#enabled=1
    
    if !exists('g:airline_symbols')
        let g:airline_symbols = {}
    endif
    let g:airline_symbols.space = "\ua0"
    
    
    posted in Linux
  • 推荐一下我的vim配置

    最终效果图:
    QQ截图20200912163204.jpg
    一入vim深似海 从此gui是路人


    0. 安装vim

    想要配置vim,首先肯定需要有vim这个软件。
    鉴于vim的强大和高效,很多系统都支持他,例如Windows,Mac OS,Linux,甚至OpenWrt。
    安装方法也很简单

    Windows (gvim)

    下载安装包安装

    https://github.com/vim/vim-win32-installer/releases

    或者,直接通过win-get也可以进行安装

    winget install vim
    

    Mac OS

    略(我没用过Mac,但是听说有些Mac程序员也喜欢用vim,所以明显Mac也是支持的)

    Linux

    一般发行版的仓库都会内置vim,直接用软件包管理程序安装即可

    Debian系

    sudo apt install vim
    

    RH系

    sudo yum install vim
    

    1. 安装并配置Vundle

    Vundle是一款用来管理vim插件的插件,而且可以通过git更新插件

    1.1 安装git

    和安装vim的方法一样,例如Debian系可以通过sudo apt install git来进行安装

    1.2 下载Vundle

    通过git进行克隆

    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    

    1.3 配置插件

    首先,需要将以下配置加入~/.vimrc开头

    set nocompatible              " be iMproved, 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 'VundleVim/Vundle.vim'
    
    " The following are examples of different formats supported.
    " Keep Plugin commands between vundle#begin/end.
    " plugin on GitHub repo
    Plugin 'tpope/vim-fugitive'
    " plugin from http://vim-scripts.org/vim/scripts.html
    " Plugin 'L9'
    " Git plugin not hosted on GitHub
    Plugin 'git://git.wincent.com/command-t.git'
    " git repos on your local machine (i.e. when working on your own plugin)
    Plugin 'file:///home/gmarik/path/to/plugin'
    " The sparkup vim script is in a subdirectory of this repo called vim.
    " Pass the path to set the runtimepath properly.
    Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
    " Install L9 and avoid a Naming conflict if you've already installed a
    " different version somewhere else.
    " Plugin 'ascenator/L9', {'name': 'newL9'}
    
    " All of your Plugins must be added before the following line
    call vundle#end()            " required
    filetype plugin indent on    " required
    " To ignore plugin indent changes, instead use:
    "filetype plugin on
    "
    " Brief help
    " :PluginList       - lists configured plugins
    " :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
    " :PluginSearch foo - searches for foo; append `!` to refresh local cache
    " :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
    "
    " see :h vundle for more details or wiki for FAQ
    " Put your non-Plugin stuff after this line
    

    之后,就可以在call vundle#begin()call vundle#end()之间添加你想安装的插件了
    这里推荐2个插件。valloric/YouCompleteMe,可以用来代码补全。tomassiser/vim-code-dark,vscode的暗色主题

    1.4 插件安装

    vim +PluginInstall +qall
    

    *1.5 编译安装YouCompleteMe

    python3 ~/.vim/bundle/YouCompleteMe/install.py --all
    python3 ~/.vim/bundle/YouCompleteMe/install.py --clangd-completer
    

    *1.6 配置YouCompleteMe

    .vimrc文件后面追加内容:

    let g:ycm_key_invoke_completion = '<c-z>'
    set completeopt=menu,menuone
    let g:ycm_add_preview_to_completeopt = 0
    

    可以将语义补全的快捷键修改为Ctrl + z,默认的Ctrl + space是切换输入法。
    可以在切换补全的时候禁用函数原型展示,避免扰乱布局

    2. 配置主题

    set t_Co=256 " 需要终端支持256色
    set t_ut=
    colorsheme codedark
    

    3. 配置状态栏

    3.1 状态栏常驻显示

    set laststatus=2
    

    3.2 获取git branch

    function! GitBranch()
        return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
    endfunction
    
    function! GetBranch()
        let l:branchname = GitBranch()
        return strlen(l:branchname) > 0? '  '.l:branchname.' ': ''
    endfunction
    

    3.3 自定义状态栏

    set statusline=
    set statusline+=%#PmenuSel#
    set statusline+=%{GetBranch()}
    set statusline+=%#LineNr#
    set statusline+=\ %F
    set statusline+=%m
    set statusline+=%=
    set statusline+=%#CursorColumn#
    set statusline+=\ %y
    set statusline+=\ %{&fileencoding?&fileencoding:&encoding}
    set statusline+=[%{&fileformat}]
    set statusline+=\ %p%%
    set statusline+=\ %l:%c
    

    显示出来的效果是 branch - 路径 - 类型 - 编码 - 行尾 - 百分比 - 行:列

    3.4 行号等杂项

    set nowrap " 取消自动折行
    set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab " 将tab键切换为4个空格
    set nu " 显示行号
    set smartindent " 智能缩进
    set mouse=a " 支持鼠标
    set cursorline " 高亮当前行
    set cc=81 " 高亮第81列(在行长度超过80时起到提示作用,避免写出不便阅读的代码)
    

    4. 配置符号配对

    其实思路就是将一个按键映射成多个按键

    inoremap ' ''<ESC>i
    inoremap " ""<ESC>i
    inoremap ( ()<ESC>i
    inoremap [ []<ESC>i
    inoremap ` ``<ESC>i
    inoremap { {}<ESC>i
    

    不建议配置尖括号的配对,尖括号只有在泛型和C/C++引入头文件时才需要配对,这种场合相对来说较少。
    但是,当你写代码需要用到小于号时,你就会发现你配置的尖括号补全有多艹蛋了...

    posted in Linux
  • RE: MSVC和GCC的二进制文件为毛不兼容啊!!!

    我觉得不兼容是正常的(

    posted in 编程
  • RE: 说说我SpringCloud微服务碰到的神奇的坑

    学什么 Java 。赶快过来用 golang

    posted in 编程