分类 代码人生 下的文章

工作学习中遇到了很多有趣的go项目和文章,收集一下

文章或视频

https://golang.org/doc/codewalk/sharemem/
https://blog.labix.org/2011/10/09/death-of-goroutines-under-control
https://blog.golang.org/share-memory-by-communicating
https://golang.org/doc/codewalk/sharemem/
https://www.youtube.com/watch?v=lLDWF59aZAo
http://satran.in/2017/11/15/Implementing_tails_follow_in_go.html
https://www.flysnow.org/
https://github.com/polaris1119/The-Golang-Standard-Library-by-Example
https://projecteuler.net/

学习资料

https://github.com/mikespook/Learning-Go-zh-cn
https://astaxie.gitbooks.io/build-web-application-with-golang/content/zh/
https://gobyexample.com/
https://github.com/Unknwon/go-fundamental-programming
https://github.com/Unknwon/go-rock-libraries-showcases
https://golang.org/doc/effective_go.html
https://blog.golang.org/laws-of-reflection
https://www.youtube.com/channel/UC_BzFbxG2za3bp5NRRRXJSw

项目

https://github.com/go-cmd/cmd
https://github.com/fsnotify/fsnotify
https://github.com/nathany/looper
https://github.com/hpcloud/tail
https://gopkg.in/tomb.v2
https://github.com/fatih/color
https://github.com/mattn/go-colorable
https://github.com/gongo/9t
https://github.com/shanghai-edu/multissh
https://github.com/gogs/gogs
https://github.com/pkg/errors

Golang syslist

Golang预定义的OS列表

aix
android
darwin
dragonfly
freebsd
hurd
js
linux
nacl
netbsd
openbsd
plan9
solaris
windows
zos

Golang预定义的Arch(架构)列表

386
amd64
amd64p32
arm
armbe
arm64
arm64be
ppc64
ppc64le
mips
mipsle
mips64
mips64le
mips64p32
mips64p32le
ppc
riscv
riscv64
s390
s390x
sparc
sparc64
wasm

你认识几个?

程序猿面试

找新工作的念头是在今年6月开始萌发的,其实当时已经开始投简历了,结果因为种种原因(主要是忙?)拖到这会儿才真正开始面试。投简历的平台是boss直聘,简历用的jobDeer的模板,用md写好,生成pdf和doc格式,挂在自己的网站下,方便下载和浏览。

阅读剩余部分

第一次学习KMP算法走了不少弯路,下面老高按照自己的学习步骤,总结一下KMP算法的要点,如果有错误或者疑问,欢迎指正!

老高使用python语言实现算法,实现的语言不重要,重要的是他的思想!(其实老高的C语言早已年久失修?)

本文是系列的第二篇,主要探讨一下KMP算法的思维方式并引出next数组概念。

阅读剩余部分

第一次学习KMP算法走了不少弯路,下面老高按照自己的学习步骤,总结一下KMP算法的要点,如果有错误或者疑问,欢迎指正!

老高使用python语言实现算法,实现的语言不重要,重要的是他的思想!(其实老高的C语言早已年久失修?)

本文是系列的第一篇,学习KMP之前最好了解一下朴素算法的写法,为以后的学习最好铺垫,此为渐进式学习!

阅读剩余部分

#!/usr/bin/env python3
# coding=utf-8


class Node:
    def __init__(self, data):
        self._data = data
        self._next = None

    def set_next(self, node):
        self._next = node

    def set_data(self, data):
        self._data = data

    def get_data(self):
        return self._data

    def get_next(self):
        return self._next


class SingleCycleLinkedList:
    def __init__(self):
        self.head = Node(None)
        self.head.set_next(self.head)

    # 清空/初始化
    def clear(self):
        self.head.set_next(self.head)

    # 是否为空
    def is_empty(self):
        return self.head.get_next() == self.head

    # 获取大小
    def size(self):
        count = 0
        cur = self.head.get_next()
        while cur != self.head:
            count = count + 1
            cur = cur.get_next()
        return count

    # 搜索是否存在
    def search(self, data):
        cur = self.head.get_next()
        while cur != self.head:
            if cur.get_data() == data:
                return True
            cur = cur.get_next()
        return False

    # 移除指定元素
    def remove(self, data):
        prev = self.head
        while prev.get_next() != self.head:
            cur = prev.get_next()
            if cur.get_data() == data:
                prev.set_next(cur.get_next())
            prev = prev.get_next()

    # 头插
    def insert(self, data):
        temp = Node(data)
        temp.set_next(self.head.get_next())
        self.head.set_next(temp)

    # 尾插
    def append(self, data):
        # 建立node
        temp = Node(data)
        cur = self.head
        # 拿到最后一个node
        while cur.get_next() != self.head:
            cur = cur.get_next()
        # 插入
        temp.set_next(self.head)
        cur.set_next(temp)

    def print_me(self):
        cur = self.head.get_next()
        while cur != self.head:
            print cur.get_data()
            cur = cur.get_next()


if __name__ == '__main__':
    a = SingleCycleLinkedList()
    a.append('aa')
    a.remove('aa')
    a.print_me()