Skip to content

Instantly share code, notes, and snippets.

View tenfyzhong's full-sized avatar
:octocat:

tenfy tenfyzhong

:octocat:
View GitHub Profile
// @file main.go
// @brief
// @author tenfyzhong
// @email tenfyzhong@qq.com
// @created 2017-06-26 17:54:34
package main
import (
"flag"
"fmt"
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import commands
import time
def usage():
print('./udpstat.py duration')
@tenfyzhong
tenfyzhong / yyerror.txt
Created July 6, 2017 07:56
golang error message
src/cmd/compile/internal/gc/align.go:24: yyerror("interface too large")
src/cmd/compile/internal/gc/align.go:78: yyerror("type %L too large", errtype)
src/cmd/compile/internal/gc/align.go:123: yyerrorl(t.Lineno, "invalid recursive type %v", t)
src/cmd/compile/internal/gc/align.go:215: yyerror("channel element type too large (>64kB)")
src/cmd/compile/internal/gc/align.go:226: yyerror("invalid recursive type %v", t)
src/cmd/compile/internal/gc/align.go:247: yyerror("use of [...] array outside of array literal")
src/cmd/compile/internal/gc/align.go:257: yyerror("type %L larger than address space", t)
src/cmd/compile/internal/gc/align.go:299: yyerror("type %v too large", t)
src/cmd/compile/internal/gc/bexport.go:804: yyerrorl(t.Lineno, "cannot export unnamed recursive interface")
src/cmd/compile/internal/gc/bimport.go:230: yyerror("cannot import %q due to version skew - reinstall package (%s)",
function! s:to_qf()
redir => output
silent messages
redir END
let contents = split(output, '\n')
" echom 'contents: ' . output
" call setqflist(contents)
let qflist = []
let bufnr = bufnr('%')
for c in contents
func mergeBetweenWord(list [][]string) []string {
if len(list) == 0 {
return []string{}
}
levelResult := [][]string{}
levelResult = append(levelResult, []string{""}) // 塞一个空,下面就不用进行判断是否空了
count := 0
for i, word := range list {
package combination
// 对list求所有的子序列
// 比如:西藏区,西的拼音有:xi,藏的拼音有:zang,cang,区的拼音有:qu,ou
// 求出所有的子串:西,西藏,西区,西藏区,藏,藏区,区
// 的所有拼音组合
func subCombination(list [][]string) []string {
if len(list) == 0 {
return nil
}
@tenfyzhong
tenfyzhong / .vimrc
Last active July 25, 2017 03:11
airline tabline redraw bug
set rtp+=~/.vim/bundle/vim-airline
set rtp+=~/.vim/bundle/vim-ctrlspace
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_tabs = 0
au BufEnter * redraw
@tenfyzhong
tenfyzhong / fork_wait.go
Last active July 26, 2017 02:22
monitoring subprocess status
package main
import "fmt"
import "os"
import "syscall"
import "time"
func forkExec() {
pa := &syscall.ProcAttr{
Env: os.Environ(),
@tenfyzhong
tenfyzhong / .vimrc.fzf
Created July 28, 2017 03:28
fzf history search block
set rtp+=/usr/local/opt/fzf
set rtp+=~/.vim/bundle/fzf.vim
set rtp+=~/.vim/bundle/incsearch.vim
let g:fzf_command_prefix = 'FZF'
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jul 14 2017 10:19:18)
MacOS X (unix) version
Included patches: 1-705
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte +terminfo